Grouping wages by hour

  • Thread starter Thread starter Winnetou
  • Start date Start date
W

Winnetou

Hi,

I have a query which lists salaries as follows:

John 1/1/03 $9.00 7:07AM 4:00PM
Nancy 1/7/03 $7.50 3:05PM 5:37PM
....

I would like to sum up all wages by hour and display the result as
follows:

7:00AM $9.00
8:00AM $9.00
....
3:00PM $16.5
....

Currently, I have set up a query to sort out wages by hour and added
24 union queries to sum up the results. Needless to say, the result is
slow. Is there a more efficient way?

Thanks for your input,

Mark
 
The first step would be to create a table of all hours in the day. The
structure depends on how your table is structured. Are you using date/time
fields? What are your field names?
Conceptually, you would add the table of times to the query without any join
lines. Then set the criteria under the [HoursOfDay] field to Between
[StartTime] and [EndTime]. This will create a record for every hour a person
is on the clock.
 
Back
Top