Hi
I am currently busy on some reporting for a client.
The data for the report is fine there is one problem.
I have data which is being imported to the system via txt documents which is compared to work which is completed at certain stages in my program.
The client has now requested that on the report if the item passes a particular stage more than once in a day the report should only show the first time the item has passed that stage currently my query is
SELECT DISTINCT
dbo.LIstAllStages.Serial, dbo.LIstAllStages.type, dbo.LIstAllStages.type2, dbo.LIstAllStages.Symptom, dbo.LIstAllStages.Comment,
dbo.ImportFile.CodeGroup, dbo.Importfile.Code, dbo.ImportFile.comment,
dbo.LIstAllStages.WorkCompleted, dbo.LIstAllStages.Stage
FROM dbo.ImportFile INNER JOIN
dbo.LIstAllStages ON dbo.ImportFile.serial COLLATE Latin1_General_CI_AS = dbo.LIstAllStages.Serial
WHERE dbo.LIstAllStages.Stage = 'SSH'
UNION ALL
SELECT DISTINCT
dbo.LIstAllStages.Serial, dbo.LIstAllStages.type, dbo.LIstAllStages.type2, dbo.LIstAllStages.Symptom, dbo.LIstAllStages.Comment,
dbo.ImportFile.CodeGroup, dbo.Importfile.Code, dbo.ImportFile.comment,
dbo.LIstAllStages.WorkCompleted, dbo.LIstAllStages.Stage
FROM dbo.ImportFile INNER JOIN
dbo.LIstAllStages ON dbo.ImportFile.serial COLLATE Latin1_General_CI_AS = dbo.LIstAllStages.Serial
WHERE dbo.LIstAllStages.Stage = 'SHS'
Please assist in how i could show just the first time the serial will show based on the workcompleted date.