BusinessObjects Board

Date Difference

Hi All,

I know this topic has been discussed many times in the forum
Basically I’m looking at calculating the Time differenc between 2 dates and get the result in the following format : [h]mm:ss
I used the solution proposed by Marek (Diky !) which is fantastic - The only issue I have is that the output is in a “Text” format.

My question is, is there a way to convert the output back in a format such as [H]:mm:ss (proper date format) so I can use this field to do some calculation ?

Thanks in advance

olivierC :ireland: (BOB member since 2010-01-20)

Welcome to B:bob:B! Use ToDate() to convert the string to Date. :idea:

Jansi :india: (BOB member since 2008-05-12)

Hi Jansi

Thanks for you suggestion

The variable [Time Diff Hours] returns the time difference in the following format : 17:12:54 ; 27:26:12 which would be perfect if I wouldn’t have to do some calculation on this field

I tried to use the ToDate but the format I’m looking for doesn’t seem to exist in BO : [H]:mm:ss

If I create another variable using =ToDate([Time Diff Hours];“hh:mm”) it returns #ERROR and anyway I can’t use the hh:mm format since the time difference can be greater than 24 hours therefore I need to be able to display the time diff like : 27:21:13


olivierC :ireland: (BOB member since 2010-01-20)

If the difference is just between times - so between 17:15:32 and 18:32:15 for example - why not have your variable treat each time as if it were on (or from (because you say you’ve got one instance of 27 hours, so many minutes, so many seconds))day 1, so 01/01/1900 17:15:32.

There’d be no need to show in a report that the time is on the 01/01/1900 as you could format the cell to show hh:mm:ss format easily.

If you did this and altered your variable to give you "01/01/1900 " + (Formula for hh:mm:ss (I used Mareks yesterday & it’s awesome!)) you could then effectively wrap that inside a todate() function as Jansi suggested.

The resultant variable would be a date & you’d be able to get to the number of seconds between it and another easily.

SteveD :uk: (BOB member since 2009-11-02)