472,104 Members | 1,127 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,104 software developers and data experts.

Query Where Date "is null" not working

mkremkow
Hello all,

Access 2003 Windows PC:

I am trying to figure out why my Query isn't working. In this query, I want to get only those jobs that are still open and where at least one of four Yes/No fields is "Yes".

In my query, "Date Closed" field criteria "is null". My result is a listing of all jobs that have at least one of the four Yes/No fields, regardless of close date. Any suggestions?

Thanks!
Jul 25 '07 #1
7 21707
JKing
1,206 Expert 1GB
Could you post your SQL for this query? This helps greatly in solving problems.
Jul 25 '07 #2
abolos
65
Hello all,

Access 2003 Windows PC:

I am trying to figure out why my Query isn't working. In this query, I want to get only those jobs that are still open and where at least one of four Yes/No fields is "Yes".

In my query, "Date Closed" field criteria "is null". My result is a listing of all jobs that have at least one of the four Yes/No fields, regardless of close date. Any suggestions?

Thanks!
You want something like:

SELECT tblNameAge.stName, tblNameAge.stAge, tblNameAge.Sex, tblNameAge.Married, tblNameAge.Divorced, tblNameAge.Single
FROM tblNameAge
WHERE (((tblNameAge.Divorced)=Yes)) OR (((tblNameAge.Single)=Yes));
Jul 26 '07 #3
JKing
1,206 Expert 1GB
Yes, that's what I'm looking for but post the SQL for the query you're having a problem with. The one you spoke of in your first post.
Jul 26 '07 #4
Okay - her is what I have:

SELECT [Job Log].[Date Closed], [Job Log].WebDueDate, [Job Log].ThePulse, [Job Log].Internet, [Job Log].Desktop, [Job Log].MedWeb, [Job Log].[Job ID], [Job Log].[Document Name], [Job Log].[Marketing Rep Name]
FROM [Job Log]
WHERE ((([Job Log].[Date Closed]) Is Null) AND (([Job Log].ThePulse)=Yes)) OR ((([Job Log].Internet)=(Yes))) OR ((([Job Log].Desktop)=(Yes))) OR ((([Job Log].MedWeb)=(Yes)))
ORDER BY [Job Log].WebDueDate;

Thanks!
Jul 26 '07 #5
JKing
1,206 Expert 1GB
Hi there, the problem is that the Null constraint on the date is only being placed in the first case. If you look at the where statement as having seperate cases split by the keyword OR then you will see that its groups DateClosed and ThePulse as one and then each of the other Yes/no fields as a seperate case or condition if you will.

So here's how you can fix it:
Expand|Select|Wrap|Line Numbers
  1. SELECT [Job Log].[Date Closed], [Job Log].WebDueDate, [Job Log].ThePulse, [Job Log].Internet, [Job Log].Desktop, [Job Log].MedWeb, [Job Log].[job ID], [Job Log].[Document Name], [Job Log].[Marketing Rep Name]
  2. FROM [Job Log]
  3. WHERE ((([Job Log].[Date Closed]) Is Null) AND (([Job Log].ThePulse)=Yes))
  4. OR ((([Job Log].[Date Closed]) Is Null) AND (([Job Log].MedWeb)=Yes)) 
  5. OR ((([Job Log].[Date Closed]) Is Null) AND (([Job Log].Desktop)=Yes)) 
  6. OR ((([Job Log].[Date Closed]) Is Null) AND (([Job Log].Internet)=Yes));
  7.  
Jul 26 '07 #6
That's it! Thank you - it works perfectly now!
Jul 26 '07 #7
JKing
1,206 Expert 1GB
You're very welcome!

Jking
Jul 26 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

32 posts views Thread by Nuno Paquete | last post: by
4 posts views Thread by jno.aubrey | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.