basic sql sum statement - help i'm going mad

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi

I have a table that displays some advert costs for an agency.

one colum is 'order total'

i can get total for all orders but cannot filter on a date range

i think the sum query should be used to do the calculation on the fly
but i'm just not getting it.

sweets for the first avaiable solution.

dan
 
Dan said:
I have a table that displays some advert costs for an agency.

one colum is 'order total'

i can get total for all orders but cannot filter on a date range

i think the sum query should be used to do the calculation on the fly
but i'm just not getting it.


If you want the total for all orders in the table that are
in the specified date range:

SELECT Sum([order total[) As SumOfOrders
FROM [a table]
WHERE [order date] Between [start date] And [end date]

That seems a little too simple to be useful so If you need
to do something else, please explain.
 
Back
Top