Need Help counting dates that are not null...

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
 
J

John Spencer (MVP)

Try

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

or

Count([Date])

Count counts all non-null values (0 is a non-null value)
 
K

Ken Snell

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)
 
D

Duane Hookom

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.
 
B

Brainwave Surfer

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
 
Top