Hi Experts and Fellow Duffers:
I am trying to create a query which will identify the most recent EndDate in tblSchedules associated with tblKids.KidID where a Null value (indicating a current schedule) is the most recent.
Max(EndDate) doesn't recognize Null as the highest value. Last(EndDate) returns the most recently entered schedule but not the most recent EndDate.
Any suggestions? My query so far:
[CODE=sql]SELECT tblKids.KidID, Min(tblSchedule s.StartDate) AS OriginalStart, Max(tblSchedule s.EndDate) AS FinalEnd
FROM tblKids INNER JOIN tblSchedules ON (tblKids.KidID = tblSchedules.Ki dID) AND (tblKids.KidID = tblSchedules.Ki dID) AND (tblKids.KidID = tblSchedules.Ki dID)
GROUP BY tblKids.KidID;
[/CODE]
Thanks,
Bradley
I am trying to create a query which will identify the most recent EndDate in tblSchedules associated with tblKids.KidID where a Null value (indicating a current schedule) is the most recent.
Max(EndDate) doesn't recognize Null as the highest value. Last(EndDate) returns the most recently entered schedule but not the most recent EndDate.
Any suggestions? My query so far:
[CODE=sql]SELECT tblKids.KidID, Min(tblSchedule s.StartDate) AS OriginalStart, Max(tblSchedule s.EndDate) AS FinalEnd
FROM tblKids INNER JOIN tblSchedules ON (tblKids.KidID = tblSchedules.Ki dID) AND (tblKids.KidID = tblSchedules.Ki dID) AND (tblKids.KidID = tblSchedules.Ki dID)
GROUP BY tblKids.KidID;
[/CODE]
Thanks,
Bradley
Comment