Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting a null field 1

Status
Not open for further replies.

jphillips

Programmer
Nov 20, 2001
24
0
0
US
Hello,

I am trying to select a null or empty date field.
I have tried writing a sql in access

select * from table_name where date_field is null;

or

select * from table_name where date_field = '';

How can I retrieve this info??
 
Are you sure that date_field allow null ?
you may try this:
select * from table_name where Nz(date_field,0)=0;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Didn't work. The field is supposed to be a date field called completed_date. I just want to find all the orders where the date has not been entered. Very simple query in Oracle. Not sure about this MS Access
 
Try.

select * from table_name where date_field is null
or len(ltrim(date_field))=0

If this work then it is either null, empty, or blank. You can then check which one.
 
ok. that worked. It also helps to use the correct column name also.(complete_date vs. completed_date.
THanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top