Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    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?

    Elizabeth

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: time calculations (A2002)

    You can put a text box in the form (?) footer with control source

    =Sum([closetime]-[opentime])*24*52/365

    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

    =[Forms]![frmMyForm]![txtDailyAverage]

    where frmMyForm is the name of the form with the text box in the footer, and txtDailyAverage is the name of that text box.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •