URGENT - Getting hours totaled for the month

H

HeatherLou1974

I have a database with our subcontractors and the hours that they worked
daily. What I need to do is get a report to total the hours that the
subcontractor worked in a month - with each subcontractor on its own page.
The page needs to show the subcontractor's name and the dates that they
worked (not a problem), the hours that they worked each day (also not a
problem), with the total at the bottom of the page.
For some reason, I can't figure out how to get the total to appear at the
bottom of the page - probably because I can't figure out how to write the
function statement.
Can anyone help?
 
M

[MVP] S.Clark

Correction, add it to the group band under the subcontractor band, which
groups the dates by month. THAT should do it..

Add page breaks, or set the force new page properties as needed, too.
 
J

John Vinson

I have a database with our subcontractors and the hours that they worked
daily. What I need to do is get a report to total the hours that the
subcontractor worked in a month - with each subcontractor on its own page.
The page needs to show the subcontractor's name and the dates that they
worked (not a problem), the hours that they worked each day (also not a
problem), with the total at the bottom of the page.
For some reason, I can't figure out how to get the total to appear at the
bottom of the page - probably because I can't figure out how to write the
function statement.
Can anyone help?

I take it you're using the Sorting and Grouping property of the Report
to group by subcontractor? If so, be sure that you have the Group
Footer visible (it's not by default); put a textbox in this Footer
with a control source =Sum([Hours]) where Hours is the number field
containing the number of hours worked. It's necessary to use the Group
Footer, not the Page Footer... this may be the source of your
difficulties.

If you're storing the hours worked in a Date/Time field, you should
reconsider: date/time fields are good for recording a point in time,
but less good for storing durations.

John W. Vinson[MVP]
 
H

HeatherLou1974

John-
Thanks for the help. I am getting closer and closer with this stupid thing
:).
I have had to use a text box for the hours worked field because Access
rounds up and I have 1/2 hours in that field. I need it to be exact. Any
ideas?
Thanks!
Heather

John Vinson said:
I have a database with our subcontractors and the hours that they worked
daily. What I need to do is get a report to total the hours that the
subcontractor worked in a month - with each subcontractor on its own page.
The page needs to show the subcontractor's name and the dates that they
worked (not a problem), the hours that they worked each day (also not a
problem), with the total at the bottom of the page.
For some reason, I can't figure out how to get the total to appear at the
bottom of the page - probably because I can't figure out how to write the
function statement.
Can anyone help?

I take it you're using the Sorting and Grouping property of the Report
to group by subcontractor? If so, be sure that you have the Group
Footer visible (it's not by default); put a textbox in this Footer
with a control source =Sum([Hours]) where Hours is the number field
containing the number of hours worked. It's necessary to use the Group
Footer, not the Page Footer... this may be the source of your
difficulties.

If you're storing the hours worked in a Date/Time field, you should
reconsider: date/time fields are good for recording a point in time,
but less good for storing durations.

John W. Vinson[MVP]
 
M

MacNut

Heather,

You don't need to change the field to a textbox though in order to keep all
fractions. If you make sure that the field is defined as having 2 decimal
places, you should be good to go with summing (define as number and "single"!)

MN

HeatherLou1974 said:
John-
Thanks for the help. I am getting closer and closer with this stupid thing
:).
I have had to use a text box for the hours worked field because Access
rounds up and I have 1/2 hours in that field. I need it to be exact. Any
ideas?
Thanks!
Heather

John Vinson said:
I have a database with our subcontractors and the hours that they worked
daily. What I need to do is get a report to total the hours that the
subcontractor worked in a month - with each subcontractor on its own page.
The page needs to show the subcontractor's name and the dates that they
worked (not a problem), the hours that they worked each day (also not a
problem), with the total at the bottom of the page.
For some reason, I can't figure out how to get the total to appear at the
bottom of the page - probably because I can't figure out how to write the
function statement.
Can anyone help?

I take it you're using the Sorting and Grouping property of the Report
to group by subcontractor? If so, be sure that you have the Group
Footer visible (it's not by default); put a textbox in this Footer
with a control source =Sum([Hours]) where Hours is the number field
containing the number of hours worked. It's necessary to use the Group
Footer, not the Page Footer... this may be the source of your
difficulties.

If you're storing the hours worked in a Date/Time field, you should
reconsider: date/time fields are good for recording a point in time,
but less good for storing durations.

John W. Vinson[MVP]
 
J

John Vinson

John-
Thanks for the help. I am getting closer and closer with this stupid thing
:).
I have had to use a text box for the hours worked field because Access
rounds up and I have 1/2 hours in that field. I need it to be exact. Any
ideas?

Yes, posted elsewhere in this thread.

There are several types of Number. The default Number datatype is Long
Integer which is (as the name implies) a whole number only. Single and
Double numbers allow decimal places, and may be adequate for your
needs (they have some problems with roundoff error - if you're
searching for the vaguely remembered record with 5.1 hours you might
not find it because Access stored it as 5.099999999999999983).

Or, you can store *minutes* worked rather than hours and use
arithmatic to calculate hours and fractions, or hours and minutes.

John W. Vinson[MVP]
 
Top