Totals run only between dates

  • Thread starter Thread starter Galin
  • Start date Start date
G

Galin

Hi, group

I have a table with ID,
Dates,
Codes: REG(regular), VAC(vacation),OVT(overtime)
Hours: REG_H(regular hours), VAC_H(vacation hours),
OVT_H(overtime hours).

The words Codes and Hours are not included, only the
abbreviation REG,VAC,OVT and REG_H,VAC_H,OVT_H.

How do I construct a query when I specify a date range
let's say between 2000/01/01 and 2002/01/01 my query adds
up Total REG_H, VAC_H, and OVT_H.

This then has to be included in a form where user will
select dates and report will be displayed with the dates
and totals.

I need help with the calculation of the Totals when
specifing a date range.

Thank you
 
Maybe

SELECT Sum(REG_H) + Sum(VAC_H) + Sum(OVT_H) WHERE Dates BETWEEN
#2000/01/01# AND #2002/01/01#

will do the trick?
Or perhaps you need totals for each of them separately? :-) Then just
replace pluses with commas.
Pavel
 
It worked well
Thank you
-----Original Message-----
Maybe

SELECT Sum(REG_H) + Sum(VAC_H) + Sum(OVT_H) WHERE Dates BETWEEN
#2000/01/01# AND #2002/01/01#

will do the trick?
Or perhaps you need totals for each of them separately? :- ) Then just
replace pluses with commas.
Pavel

.
 
Back
Top