Summing year occurences

Peter Bellamy

Registered User.
Local time
Today, 15:39
Joined
Dec 3, 2005
Messages
295
Access 2003
I have report with many records appearing in the detail section
The records include a date field.
I want to put a total in the report footer that is the sum of the records with 2004, 20005 ..... and 2009 dates.
For some reason my usual way of doing this is erroring.

The field with the date is [mal2_date]
I created an unbound text field in the detail for each year like: =Iif(Format([mal2_date] = "yyyy") = 2004, 1, 0) which puts a 1 or 0 in the report detail.
If I then put its Running Sum setting to "Over All", it goes to Error ??

I have used this method lots of times and never had this problem what am I doing wrong?

Thanks
 
Iif(Format([mal2_date] = "yyyy") = 2004, 1, 0)

Normally the format function syntax would be:
Format([mal2_date], "yyyy")

I have not seen it used before with the equal sign instead of a comma.
 
Yes, sorry, typo in my post.
It should have a comma not an = sign.

Thanks
 

Users who are viewing this thread

Back
Top Bottom