HoganGroup
Technical User
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 )
1.
SELECT tblKids.KidID, Min(tblSchedules.StartDate) AS OriginalStart, Max(tblSchedules.EndDate) AS FinalEnd
2.
FROM tblKids INNER JOIN tblSchedules ON (tblKids.KidID = tblSchedules.KidID) AND (tblKids.KidID = tblSchedules.KidID) AND (tblKids.KidID = tblSchedules.KidID)
3.
GROUP BY tblKids.KidID;
Someone suggested to use Nz() but I want to retain the null value. Also, I noted that it fired after the query evaluated Max() so it wasn't much good.
Suggestions greatly appreciated,
Bradley
THANKS!
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 )
1.
SELECT tblKids.KidID, Min(tblSchedules.StartDate) AS OriginalStart, Max(tblSchedules.EndDate) AS FinalEnd
2.
FROM tblKids INNER JOIN tblSchedules ON (tblKids.KidID = tblSchedules.KidID) AND (tblKids.KidID = tblSchedules.KidID) AND (tblKids.KidID = tblSchedules.KidID)
3.
GROUP BY tblKids.KidID;
Someone suggested to use Nz() but I want to retain the null value. Also, I noted that it fired after the query evaluated Max() so it wasn't much good.
Suggestions greatly appreciated,
Bradley
THANKS!