Results 1 to 2 of 2
Thread: time calculations (A2002)
2003-11-19, 13:28 #1
- Join Date
- Jul 2002
- Cedar Falls, Iowa, USA
- Thanked 0 Times in 0 Posts
time calculations (A2002)
I've set up a form that calculates hours of operation each day, an unbound control with record source set to [closetime]-[open time]. I need to sum those times in the report footer and then multiply the weekly total by 52 weeks per year and divide by 365 days per year. I then need to push this value into a control on another form.
I'm having abysmal luck in finding out how to sum, multiple and divide time and finding the technique used to push a value into a form. Any guidance?
2003-11-19, 13:47 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: time calculations (A2002)
You can put a text box in the form (?) footer with control source
Dates and times are stored with 1 day (24 hours) as unit. So the sum is a number of days. I assumed that you wanted the number in hours. So multiply by 24 to get hours and by 52 to get the yearly total, then divide by 365 to get the daily average.
Note: a year is not exactly 52 weeks and not always 365 years, so the answer is not entirely accurate. You might as well divide the weekly total by 7 to get the daily average.
To refer to the outcome on another form, create a text box with control source
where frmMyForm is the name of the form with the text box in the footer, and txtDailyAverage is the name of that text box.