Display Null Values Between Dates

daveUK

Registered User.
Local time
Today, 08:01
Joined
Jan 2, 2002
Messages
234
Hi Guys

I have 2 tables - TblCostCode, which lists all available cost codes and TblPhotocopy, which users can enter jobs. Each job has a cost code.

I want to be able to list all of the cost codes that haven't been used between certain dates. I can display all of the cost codes that have never been used by using the 'is null' in the criteria, but I can't get it to work between specified dates.

This is the SQL of the query.

SELECT TblCost_Code.Cost_Code, TblPhotocopy.[Cost Code], TblPhotocopy.[Completion Date]
FROM TblCost_Code LEFT JOIN TblPhotocopy ON TblCost_Code.Cost_Code = TblPhotocopy.[Cost Code]
WHERE (((TblPhotocopy.[Cost Code]) Is Null) AND ((TblPhotocopy.[Completion Date]) Between [Forms]![FrmCostCodeNotUsed]![TxtStart] And [Forms]![FrmCostCodeNotUsed]![TxtEnd]))
ORDER BY TblCost_Code.Cost_Code;

It works without the date, but with the date the query doesn't return any records.

Dave
 
Thanks Pat, I had to change the query slightly, but I've got it working.

Dave
 

Users who are viewing this thread

Back
Top Bottom