Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    time difference (2003)

    Hi, is it possible to calculate the time difference (hours and minutes) between two times if they are in the short time format (rather than date/time)? thanks, Van

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

    Re: time difference (2003)

    Date/time is a data type that determines how a field is stored, while Short Time is a display format that determines how a field is displayed.
    If you have two times that are stored as date/time, it doesn't really matter what the display format is. You can calculate the difference by subtracting the earlier of the two from the later one:
    [Time2]-[Time1]
    Format the difference as Short Time.

  3. #3
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: time difference (2003)

    Thanks Hans. That calculates the difference ok, but doesn't take into account the date change (i.e. from 22:00 at night to 07:00 in the morning for example). I guess I will need to use the general date format, even thought this makes data entry a bit more involved for the users. Thanks again, Van

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

    Re: time difference (2003)

    It depends on what you want to use it for. If it's to calculate the length of (for example) a shift that may cross midnight, you could use

    =[Time2]-[Time1]-([Time2]<[Time1])

    If Time1 = 22:00 and Time2 = 07:00, this expression will result in 09:00.

Posting Permissions

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