Most Recent Date Query Need Nulls

tritenick

Registered User.
Local time
Today, 13:14
Joined
Jul 3, 2012
Messages
10
I have two querys, one pulls the most recent date for training and when run by itself includes nulls. However, on the next query I am adding a year to the most recent training to create a due date and selecting only those dates that are less than today. (To see who is due for annual training.) But now it doesn't include the null dates. Here is the SQL:

SELECT qrySafety.MostRecent, qrySafety.Training, DateAdd("y",1,[qrySafety]!MostRecent) AS [Due Date], [Last Name] & ", " & [First Name] AS [Full Name], [Workers].Active, [Workers].Department, [Series Codes].Facility, [Workers].RAM
FROM (qrySafety INNER JOIN [Workers] ON qrySafety.[Employee ID] = [Workers].ID) INNER JOIN [Series Codes] ON [Workers].[Series Code] = [Series Codes].[Series Code]
WHERE ((([Workers].Active)=Yes) AND (([Workers].RAM)=No) AND ((DateAdd("y",1,[qrySafety]![MostRecent]))<=DateAdd("m",-1,Date())));


Any pointers greatly appreciated!
 
Your query is excluding the Nulls because you have put criteria in your WHERE clause based on the date. If a record has a Null date, then its going to fail the criteria.
 

Users who are viewing this thread

Back
Top Bottom