Need Help counting dates that are not null...

  • Thread starter Thread starter Brainwave Surfer
  • Start date Start date
B

Brainwave Surfer

I'm trying to use the iif(IsNull(date), 1, 0) to determine if I count
the little buggers, but it either counts all the dates reguardless of
whether they are null or not.

any ideas?

Jim
 
Try

SUM(IIF(IsNull([Date]),0,1)

or

Count([Date])

Count counts all non-null values (0 is a non-null value)
 
Date is a function in VBA that returns the current date. I assume that
you're using date as the name of a control or field -- if yes, *not a good
idea to do that!*, surround it with [ ] characters:

IIf(IsNull([date], 1, 0)
 
I wonder if you are providing the full expression? Are you using Count or
Sum? This expression should use Sum. If you just had the date field, then
you should be able to use Count to count the non-null dates.
 
Brainwave said:
I'm trying to use the iif(IsNull(date), 1, 0) to determine if I count
the little buggers, but it either counts all the dates reguardless of
whether they are null or not.

any ideas?

Jim
Thanks for all the pointers...

the [ ] around the date variable was what I was missing...

thanks you guys so very much!!!!! I was going slowly insane.

Jim
 
Back
Top