Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2009
    Posts
    8

    Unanswered: Subtract Datetime

    Hi,

    I have 2 datetime fields and i would like to find the difference of the two and display in a third field. How will it be done?

    ScanDateTime & DataDateTime : yy/mm/dd hh:mm:ss format
    Longest Time : hh:mm:ss format

    The fields i have are:

    Code:
    ScanDateTime            DataDateTime              Longest Time
    09/11/15 05:00:00      09/12/03 10:47:00             ???

    Sankur.

  2. #2
    Join Date
    May 2009
    Posts
    258
    Just enter a formula in the Longest Time of B2-A2 and then format it the way you want. For example, you could format it as follows to get it to say "18 days, 05 hours, 47 minutes":
    Code:
    dd "days," hh "hours," mm "minutes"
    You could also just format the cell as a number and get a value of 18.24.

    Ax

  3. #3
    Join Date
    Nov 2009
    Posts
    8
    Ax,

    I used the "B2-A2" way to get the Longest TIme and set the format as "Custom - hh:mm:ss", but im not getting the corrext value.

    Code:
    ScanDateTime            DataDateTime              Longest Time
    09/11/15 05:00:00      09/12/03 10:47:00           05:47:00
    I want the time to be shown in the "hh:mm:ss" format. But it is not working.

    Sankur.

  4. #4
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    511
    If you want the day difference to be accrued within the hours then change the custom format to [hh]:mm:ss

    That would display a result of 437:47:00

    Hope that helps...

  5. #5
    Join Date
    Nov 2009
    Posts
    8
    Thanks - i got it now.

Posting Permissions

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