calculate sum in a query

R

rockyd7

I am running a query and looking to create a total of all the items in one
particular field. I want a seperate column on my report to show the total in
addition to each individual item that is a part of the total. Any ideas?
Also, can a query be set to only show items from one particular calendar
month as opposed to a 30 day period? I am a new user to Access and may need
things spelled out for me a little more than the average user.

Thanks for all your help! :)

Rocky
 
J

John Vinson

I am running a query and looking to create a total of all the items in one
particular field. I want a seperate column on my report to show the total in
addition to each individual item that is a part of the total. Any ideas?

The simplest way to do this is to use the *report* to do the
calculation, rather than the query. If you want a running total, just
add a textbox to the report, with its Control Source being the field
that you want summed, and set its RunningSum property to True. If you
want to (repeatedly) show the grand total, set its Control Soucre to

=DSum("[fieldname]", "[queryname]", "<optional parameters>")

See the online help for DSum for details.
Also, can a query be set to only show items from one particular calendar
month as opposed to a 30 day period? I am a new user to Access and may need
things spelled out for me a little more than the average user.

Sure. Use a criterion on a date time field such as
= DateSerial([Enter year:], [Enter month number:], 1) AND < DateSerial([Enter year:], [Enter month number:] + 1, 1)


John W. Vinson[MVP]
 
Top