Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi,

    I'm trying to figure out total time in a query for a time sheet. I have [starttime] and [endtime] which the user enters data in. The I have [Totaltime] which is a formula. I tried [endtime]-[starttime] but that didn't give me the correct results. Then I tried

    Totaltime: Format([endtime]-[starttime],"short time")

    which gives me the correct time. However, when I go to add up the [Dailytime] it doesn't work. I'm not sure what I'm doing wrong.

    Thanks,
    Leesha

  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use the [endtime]-[starttime] expression. Change the field property to Short Time. Right click on the field and choose properties and enter Short Time for the Format.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    If the sum of the times is greater than 24 hours, then you won't be able to display it correctly as time. Times can't be more than 24 hours because dates and times are stored as decimals with the whole number part representing the Days and the decimal the Hours.

    I usually use something like ([endtime]-[startime])* 24 which converts it from time into a number of hours as a number. They can be added up easily, and give the right answer if multiplied by, say, a rate of pay.
    Regards
    John



  4. #4
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by John Hutchison View Post
    If the sum of the times is greater than 24 hours, then you won't be able to display it correctly as time. Times can't be more than 24 hours because dates and times are stored as decimals with the whole number part representing the Days and the decimal the Hours.

    I usually use something like ([endtime]-[startime])* 24 which converts it from time into a number of hours as a number. They can be added up easily, and give the right answer if multiplied by, say, a rate of pay.
    That worked perfectly!!!

    Thanks!
    Leesha

Posting Permissions

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