J
jon
Hi
I am having trouble with the following query
SELECT DISTINCTROW First(Baan.dueDate) AS FirstOfDueDate, First(Baan.Job) AS
FirstOfJob, Componets.[Componet short Name],
First((Format([DueDate],"yyyy")) & IIf(Format([DueDate],"ww")<10,0 &
Format([DueDate],"ww"),Format([DueDate],"ww"))) AS DueWeek,
First(Baan.OrderNo) AS FirstOfOrderNo
FROM Componets INNER JOIN (ComponentNos INNER JOIN Baan ON
ComponentNos.[Componet No] = Baan.Job) ON Componets.RefNo =
ComponentNos.RefNo
WHERE (((Componets.Frame)=[Forms]![Fr_WorkToList]![CMB_frame]) AND
((Baan.dateIcyBaan) Is Null))
GROUP BY Componets.[Componet short Name]
ORDER BY First(Baan.dueDate), First(Baan.Job);
What I need is one record per 'Componet short Name'
and this record is the oldest one i.e. first when sorted by 'Baan.dueDate'
What I am getting is one record per 'Componet short Name'
but a not the oldest record in the field 'Baan.dueDate' it seams to be a
random record i.e. it could be the 1st,2nd or 5th in the order,.
Any advise is very welcome.
Thanks
Jon
I am having trouble with the following query
SELECT DISTINCTROW First(Baan.dueDate) AS FirstOfDueDate, First(Baan.Job) AS
FirstOfJob, Componets.[Componet short Name],
First((Format([DueDate],"yyyy")) & IIf(Format([DueDate],"ww")<10,0 &
Format([DueDate],"ww"),Format([DueDate],"ww"))) AS DueWeek,
First(Baan.OrderNo) AS FirstOfOrderNo
FROM Componets INNER JOIN (ComponentNos INNER JOIN Baan ON
ComponentNos.[Componet No] = Baan.Job) ON Componets.RefNo =
ComponentNos.RefNo
WHERE (((Componets.Frame)=[Forms]![Fr_WorkToList]![CMB_frame]) AND
((Baan.dateIcyBaan) Is Null))
GROUP BY Componets.[Componet short Name]
ORDER BY First(Baan.dueDate), First(Baan.Job);
What I need is one record per 'Componet short Name'
and this record is the oldest one i.e. first when sorted by 'Baan.dueDate'
What I am getting is one record per 'Componet short Name'
but a not the oldest record in the field 'Baan.dueDate' it seams to be a
random record i.e. it could be the 1st,2nd or 5th in the order,.
Any advise is very welcome.
Thanks
Jon