afternoon all,
having a slight issue with a top 10.
have the following code:
however this returns more than the top 10 confirmdate.
i also tried:
but this returns an error in the 'from' clause.
i am attempting to get the first 20 confirmed dates for each sku and each custcode.
any suggestions would be appreciated.
regards,
longhair
having a slight issue with a top 10.
have the following code:
Code:
SELECT [CustCode], [SKU], [ConfirmedDate], [pick-ticket-num]
FROM [Table1]
WHERE [ConfirmedDate] IN
(SELECT TOP 10 a.[ConfirmedDate]
FROM [Table1] a
WHERE
(Table1.[pick-ticket-num] = a.[pick-ticket-num]) AND (Table1.SKU = a.SKU) AND (Table1.CustCode = a.CustCode)
ORDER BY [a].[CustCode] DESC);
i also tried:
Code:
SELECT [Table1].[CustCode], [Table1].[SKU], a.[ConfirmedDate]
FROM [Table1] INNER JOIN [SELECT TOP 10 [ConfirmedDate] as [First10Ship], [SKU], [pick-ticket-num]
FROM [Table1]
GROUP BY [SKU]]. AS a ON (Table1.[pick-ticket-num] = a.[pick-ticket-num]) AND (Table1.SKU = a.SKU) AND (Table1.CustCode = a.CustCode)
ORDER BY [Table1].[CustCode];
i am attempting to get the first 20 confirmed dates for each sku and each custcode.
any suggestions would be appreciated.
regards,
longhair