Viewing 15 posts - 2,206 through 2,220 (of 3,543 total)
![]() | for me, it means single dimension |
Well, I'd hate to see how long your piece of paper is...
August 31, 2005 at 9:40 am
Well, sushila, you're heaping so many on Remi (must have broad shoulders or a large back) thought there might be a few for me
August 31, 2005 at 9:36 am
Another alternative
CREATE TABLE #temp (Location int,Item int,SalesWeek int,Qty int)
INSERT INTO #temp (Location,Item,SalesWeek,Qty)
SELECT Location,Item,SalesWeek,MAX(Qty) FROM [#Table]
GROUP BY Location,Item,SalesWeek
SELECT a.Location,a.Item,a.SalesWeek,a.Qty FROM #temp a
UNION
SELECT b.Location,b.Item,b.SalesWeek,MAX(b.Qty)
FROM [#Table] b
INNER...
August 31, 2005 at 9:17 am
Maybe
SELECT a.Location,a.Item,a.SalesWeek,a.Qty
FROM [Table] a
WHERE EXISTS (SELECT 1
FROM (SELECT TOP 2 x.Location,x.Item,x.SalesWeek,x.Qty
FROM [Table] x
WHERE x.Location=a.Location AND x.Item=a.Item AND x.SalesWeek=a.SalesWeek
ORDER BY x.Qty DESC ) y
WHERE...
August 31, 2005 at 8:57 am
I'll raise your pedantic with a pedantic, the query does not return a table but a recordset
The recordset can be interpreted as a table...
August 31, 2005 at 8:17 am
Provided the AtachmentID's are sequential for each MsgID (and start at 1) then you could try this
DECLARE @maxid int,@count int,@sql nvarchar(1000),@countstr varchar(10)
SELECT @maxid = MAX([AttachmentID]) FROM t_Attachments
CREATE TABLE #temp ([MsgID]...
August 18, 2005 at 10:58 am
Not quite true. TOP keyword is SQL7 (level 70) onwards only and the error is a symptom of compatabilty albeit the poster says it is not.
Remi, your code works because of the...
August 12, 2005 at 8:10 am
If there are only 2 attachments then
SELECT
a1.AttachmentID AS [AttachmentID1],
a1.MsgID AS [MsgID1],
a1.[FileName] AS [FileName1],
a1.AttachmentContents AS [AttachmentContents1],
a2.AttachmentID AS [AttachmentID2],
a2.MsgID AS [MsgID2],
a2.[FileName] AS [FileName2],
a2.AttachmentContents AS...
August 12, 2005 at 7:27 am
Monthly below and does 1 month from the start date.
Depending on what Quarterly means you could revise this accordingly
DECLARE @NoofDays int, @StartDate char(8), @sql varchar(4000)
SET @StartDate = '20050801'
SET...
August 5, 2005 at 4:30 am
August 4, 2005 at 7:26 am
Just for fun
ISNULL(STUFF(STUFF(SOR_CODE,PATINDEX('%[0-9][a-z]%',SOR_CODE)+1,LEN(SOR_CODE),''),1,PATINDEX('%[0-9]%',SOR_CODE)-1,''),'')
August 4, 2005 at 7:08 am
Try this
DECLARE @Mode varchar(10), @StartDate char(8), @sql varchar(4000)
SET @Mode = 'Weekly'
SET @StartDate = '20050804'
SET @sql = '
DECLARE @StartDate datetime SET @StartDate='''+@startdate+''' SELECT DISTINCT 1,l.ResourceDesc,l.ResourceDesc AS [Desc]'
SELECT @sql...
August 4, 2005 at 3:20 am
Try this
DECLARE @Mode varchar(10), @StartDate datetime, @sql varchar(4000)
SET @Mode = 'Weekly'
SET @StartDate = '2005/08/01'
IF @Mode = 'Weekly'
BEGIN
SET @sql = 'ALTER TABLE #temp ADD...
August 3, 2005 at 7:13 am
Viewing 15 posts - 2,206 through 2,220 (of 3,543 total)