473,385 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 21953
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

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

Similar topics

32
by: Nuno Paquete | last post by:
Hi group. I'm using this code to see if is there any parameter for variable "menu": if($_GET == "downloads") .... But this code log errors if there is no parameter passed (this heappens at...
13
by: gary | last post by:
Hi, We all know the below codes are dangerous: { int *p = new int; delete p; delete p; } And we also know the compilers do not delete p if p==NULL. So why compilers do not "p = NULL"...
4
by: jno.aubrey | last post by:
I have a Access 97 query that has in its where clause: And ((tbl_01_LoanData.PayOffDate) Is Null) Upon execution, all records returned have no PayOffDate except 1. When I include PayOffDate in...
3
by: sfeher | last post by:
Hi All, The following code returns a valid xmlDoc (since I can evaluate and selectNodes) but its value is "xmlDoc= null" ?! Or at least this is what the FireBug shows and (xmlDoc===null) is...
0
by: Paul | last post by:
Hi All. We have a custom class which we serialize. This class is regularly updated, and the old requests do not have a problem opening, apart from a couple!!! When it try's to deserialize the...
12
by: Seeker | last post by:
First of, Hey there :). I've been reading a few threads on Access and whatnot, but I cant seem to find the answer I need. First off, I am a newbie when it comes to computers, so bear with me...
5
by: yeoj13 | last post by:
Hello, I have a db2load script I'm using to populate a large table. Ideally, my target table is required to have "Not Null" constraints on a number of different columns. I've noticed a ...
1
by: veaux | last post by:
Question deals with linking tables in queries. I'm not a code writer so use the GUI for all my queries. Table 1 - Master Table 2 - Sub1 Table 3 - Sub 2 All 3 tables have the same key field....
6
by: cleary1981 | last post by:
I have adapted code from http://dunnbypaul.net/js_mouse/ I want to use a button to create new draggable divs but i keep getting error "is null or not an object" heres the code <html> <head>...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.