I have this sql statement:
SELECT TOP (5) PartNumber,SerialNumber,MIN(WIP_CompletionDate) as dates
FROM dbo.FG_FILLIN where
Status='FG-FRESH'
and WIP_Status<>'CMPL01'
and PartNumber='P02-070161-10211-C100'
GROUP BY PartNumber,WIP_CompletionDate,SerialNumber
Result:
PartNumber SerialNumber dates
P02-070161-10211-C100 21524100046CA8001806 2010-08-08 06:59:23.183
P02-070161-10211-C100 21524100046CA8001807 2010-08-07 16:26:19.477
P02-070161-10211-C100 21524100046CA8001808 2010-08-07 16:30:20.990
P02-070161-10211-C100 21524100046CA8001810 2010-08-14 13:12:58.827
P02-070161-10211-C100 21524100046CA8001811 2010-08-09 06:58:01.263
Now if i select top (2) this is my result.
P02-070161-10211-C100 21524100046CA8001806 2010-08-08 06:59:23.183
P02-070161-10211-C100 21524100046CA8001807 2010-08-07 16:26:19.477
But Supposed to be i the result will be something like this.
P02-070161-10211-C100 21524100046CA8001808 2010-08-07 16:26:19.477
P02-070161-10211-C100 21524100046CA8001808 2010-08-07 16:30:20.990
Any Suggestions? Thanks in Regards