Totals run only between dates

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
 
P

Pavel Romashkin

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
 
G

galin

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

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top