Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002

    Unanswered: Calculating Times

    My form pulls from a query. My query has a calculating field in it.

    I have a form that shows employee information and calculates an employees # of hours worked per week.

    In my query I made a calculating field...

    Hours Worked: ([Monday Out]-[Monday In]+[Tuesday Out]-[Tuesday In]+[Wednesday Out]-[Wednesday In]+[Thursday Out]-[Thursday In]+[Friday Out]-[Friday In]+[Saturday Out]-[Saturday In]+[Sunday Out]-[Sunday In])*24

    In my subform you can change employees time in to work and time out of work for each day. So when you change an employees time it recalculates the employees hours worked within the form. But if even one field is left blank within the record[Employee ID], The Hours Worked field will not show in data... PERIOD.

    But like I said before, the form works fine IF the short time formated data is entered in Each and Every field.

    Can someone please help me understand what I have done wrong here.

  2. #2
    Join Date
    Aug 2002

    Re: Calculating Times

    Is it possible to have [Monday In], but [Monday Out] is left blank? How do you want to do with the blank? Do you want to assign a default value?

    Logically, all data should come in pair. Assuming that the "In" must have "Out" in the same day (if "In" is null, then the "Out" is null), you can just use:
    Nz([Monday Out] - [Monday In], 0) + Nz([Tuesday Out] - [Tuesday In], 0) + ...

  3. #3
    Join Date
    Nov 2002


    Thankyou very much, it worked and now I understand.

Posting Permissions

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