How do you sum based on calendar year that has multiple years?

How do you sum based on calendar year that has multiple years?

Post by Umlja » Sat, 27 Sep 2008 14:04:02


I have a DB that has dates that I want to sum up by year. I was trying to
use the IIf and DSum command together. Is there another way or how do you
imbed the DSum function in the IIf function?
 
 
 

How do you sum based on calendar year that has multiple years?

Post by Allen Brow » Sat, 27 Sep 2008 14:43:18

Use a totals query.

In query design, depress the Total button on the toolbar.
Access adds a Total row to the query design grid.

In the Field row, enter:
TheYear: Year([d])
substituting your field name for [d].
In the Total row under this field, accept Group By.

You can now sum the other field to get a total for each calendar year.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://www.yqcomputer.com/
Reply to group, rather than allenbrowne at mvps dot org.