Sum Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey,

I'm not very good with SQL and was wondering if someone can help me a bit.

I need a few queries to select from the tblInventory and do the following:

one query to give me the sum of the fields invAdjusted, invRegUsage, and
invWaste but for a date range. The date field is in InvDate.

Another one needs to get the same info but retrieve it from a particular
month...
where month(InvDate) = 1 does not seem to work for me as criteria...

Any help here would be great...

Ernst.
 
You need a Totals query; In design view click the button on the toolbar that
looks like the Autosum button in Excel. This puts a Totals row in the grid -
I'd guess you need to Group By (your date field) and change the others to
Sum. This will give a total for each unique date.

For your criteria Month([Fieldname])=1 And Year([Fieldname])=2005 should pin
it down to a month in a specific year - Month on it's own will give all
years. Hope this helps

Sheila
 
Back
Top