R
Ray
I am using a query to count the number of school days a student has been in
our program - to this end, I am using another query to find each students
start and end dates. If the end date value is null, that means they are
still enrolled, and I want the query to return the last date attendance was
recorded. I use a nz function, and it returns the right value, but it comes
back as a text data type. I need it to be a date/time type so I can use it
as part of the criteria for my other query. Is there a way to make the nz
function return a date/time data type? Or is there a better way to do this?
I can change the query to a make table query and manually change the data
type, but I need it to be automated, so that is not practical in the long run.
Here is the query I am using:
SELECT DISTINCT KCCData.Last_Name, KCCData.First_Name, KCCData.Birth_Date,
dbEnrollment.Start_Date,
nz([dbEnrollment].[End_Date],[qmaxattendance].[maxofdate]) AS End_Date
FROM SchoolDays, qMaxAttendance, KCCData INNER JOIN dbEnrollment ON
KCCData.Student_ID = dbEnrollment.Student_ID
WHERE (((dbEnrollment.Start_Date)>#7/1/2008#))
ORDER BY KCCData.Last_Name, KCCData.First_Name;
Thank you in advance for your help.
our program - to this end, I am using another query to find each students
start and end dates. If the end date value is null, that means they are
still enrolled, and I want the query to return the last date attendance was
recorded. I use a nz function, and it returns the right value, but it comes
back as a text data type. I need it to be a date/time type so I can use it
as part of the criteria for my other query. Is there a way to make the nz
function return a date/time data type? Or is there a better way to do this?
I can change the query to a make table query and manually change the data
type, but I need it to be automated, so that is not practical in the long run.
Here is the query I am using:
SELECT DISTINCT KCCData.Last_Name, KCCData.First_Name, KCCData.Birth_Date,
dbEnrollment.Start_Date,
nz([dbEnrollment].[End_Date],[qmaxattendance].[maxofdate]) AS End_Date
FROM SchoolDays, qMaxAttendance, KCCData INNER JOIN dbEnrollment ON
KCCData.Student_ID = dbEnrollment.Student_ID
WHERE (((dbEnrollment.Start_Date)>#7/1/2008#))
ORDER BY KCCData.Last_Name, KCCData.First_Name;
Thank you in advance for your help.