Viewing 15 posts - 1,666 through 1,680 (of 1,838 total)
try this:
SELECT ac.Month,
MAX(CASE WHEN ac.WeekNum = 1 THEN ClearedCount ELSE NULL END) AS [Cleared Cases on First Week],
MAX(CASE WHEN ac.WeekNum = 2...
November 26, 2008 at 2:37 pm
This should do what you are looking for:
SELECT a.AssignmentDate, a.CustomerID, c.CategoryName
FROM
(SELECT CustomerID, ActionID, AssignmentDate,
ROW_NUMBER() OVER (PARTITION...
November 26, 2008 at 1:41 pm
josephptran2002 (11/26/2008)
SELECT COUNT(ClearedDate) AS 'Month',
...
November 26, 2008 at 12:54 pm
...more specifically, are you expecting each category to be in a separate record in the resultset or are you expecting them all to be in the same row? (pivoting) ...
November 26, 2008 at 12:45 pm
lk (11/26/2008)
November 26, 2008 at 12:03 pm
josephptran2002 (11/25/2008)
from DEClearedDate
Where (Datepart(dw,ClearedDate)>=1) And (Datepart(dw,ClearedDate)<=6)
The script that I wrote above gave me
Total Cleared 24 records have been entered. But I wish to have it...
November 26, 2008 at 11:49 am
Grant Fritchey (11/26/2008)
..I mean, you won't have one customer getting five sales calls, but you will have one salesperson calling five customers, no?...
Actually I could see it going either way....
November 26, 2008 at 10:03 am
I've never had to use FORCE ORDER in SQL Server, the engine does pick the most efficient order in the work that I've done. I only mentioned it because...
November 25, 2008 at 1:17 pm
If you want to stick with using PIVOT, you need to explicitly list the values you want to "horizontalize" which are the month numbers. Try this:
select * from
...
November 25, 2008 at 10:14 am
looks like you've just got to change the last step to:
EXEC('SELECT TOP (100) PERCENT LIBID, COUNT(*) AS count INTO [dbo].[' + @temporary + '] FROM dbo.tq_old_lib_ids GROUP BY LIBID');
the INTO...
November 21, 2008 at 10:07 am
Ravi (11/21/2008)
Item Master
------------
ItemID BIGINT NOT NULL IDENTITY(1,1) PRIMARY KEY,
ItemName VARCHAR(255),
QOH NUMERIC(18,2), -- Quantity on Hand
ROL NUMERIC(18,2), -- RE-ORDER LEVEL
DATECREATED DATETIME NOT NULL DEFAULT(GETDATE())
Item Issue Master
IssueID BIGINT NOT NULL IDENTITY(1,1)...
November 21, 2008 at 8:28 am
eric.lam (11/20/2008)
AND T.PERTYPE = 1
AND T.PERDATE = '20090630'
The thing is, I...
November 21, 2008 at 8:03 am
If the REPLACE method has performance issues, another option may be to put the added space inside the ISNULL:
Ltrim((isnull(ACTION + ' ','') + isnull(QUANTITY + ' ','') + isnull(UNITOFMEASURE +...
November 20, 2008 at 2:04 pm
First, I'm not sure why you're doing the COALESCE RTRIM LTRIM on @station_list 3 times, and since @start_date and @end_date are smalldatetime, it wouldn't make sense to try to set...
November 20, 2008 at 1:58 pm
Marco André Duarte Francisco (11/20/2008)
SELECT
H.*
FROM QS10H_ACTIVIDADES H WITH(NOLOCK,INDEX(U_QS10H_ACTIVIDADES))
INNER JOIN QS10F_ESTADO_ACTIVIDADE F WITH(NOLOCK) ON (H.ID_AVARIA=F.ID_AVARIA)
QS10H_ACTIVIDADES is a table...
November 20, 2008 at 1:22 pm
Viewing 15 posts - 1,666 through 1,680 (of 1,838 total)