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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Date problem...

Status
Not open for further replies.

SherryLynn

Technical User
Feb 4, 2001
171
CA
I have another date of birth problem. In my database I track individuals where I sometimes do not have a date of birth for them. The field is left blank. On a report I need to count how many of these individuals have "unknown" or blank dates of birth. How can I do this? I'm not real familiar with VBA so a query solution or an expression of some sort would be really helpful. Any ideas? Can the field have a default entry which is something other than a date (ie. text??).

Thanks, Sherry
 
Maybe put a field in the report footer that says something like:

=dCount("DOB","Table/query Name","dob = null")

Not quite sure about the 'dob = null'

I am not sure if u can do this:
=count([dob] = null)

Nick
 
Use "Is Null" rather than "= NULL".

=dCount("*","TableName","[dob] Is Null")

Counting "*" will count the records that match the criteria. Don't count the [dob] column because Access will not count it if Null.

In a query you would use Is Null also.

Select count([col1]) As Cnt From TableName Where [dob] Is Null

Count [col1] - a non null column - rather than [dob] or "*". Access will not count the Null [dob] column and will not accept "*" in the count column. Terry

"I'm not dumb. I just have a command of thoroughly useless information." - Calvin, of Calvin and Hobbes
 
Thanks Terry,

I have always struggled with counting null fields.

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top