convert decimal to time HH:MM:SS

  • how can i convert 0.224166666666667 (equal to 807 seconds) to something similar to 00:13:27

    0.224166666666667 represents the difference between (EndDateTime - StartDateTime), i need it as a decimal value so i can sum all the records and get the total time (see example)

    start end duration

    01/01/2010 8:00:00 01/01/2010 15:00:00 7:00:00

    01/02/2010 23:00:00 01/03/2010 02:00:00 3:00:00

    01/03/2010 20:00:00 01/14/2010 21:00:00 25:00:00

    TOTAL 35:00:00

    i used this formula to calculate MM:SS and i get 13:07 (which is correct)

    =FLOOR(Fields!TimeElapsed.Value*3600/60) & ":" & RIGHT("0" & (Fields!TimeElapsed.Value*3600 MOD 60), 2)

    I'd like to have HH:MM:SS or HH:MM but i can't figure out how to get it right. Any idea?

    Thanks

  • GOT IT!

    =Floor(Fields!Time.Value*3600 / 3600) & ":"& RIGHT("0" &Floor(Fields!Time.Value *3600/ 60) - Floor(Fields!Time.Value*3600 / 3600) * 60, 2) & ":"& RIGHT("0" & Fields!Time.Value*3600 - Floor(Fields!Time.Value*3600 / 60) * 60, 2)

    and this is for the sum

    =Floor(Sum(Fields!Time.Value*3600) / 3600) & ":"& RIGHT("0" & Floor(Sum(Fields!Time.Value *3600)/ 60) - Floor(Sum(Fields!Time.Value*3600) / 3600) * 60, 2) & ":"& RIGHT("0" & Sum(Fields!Time.Value*3600) - Floor(Sum(Fields!Time.Value*3600) / 60) * 60, 2)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply