cancel
Showing results for 
Search instead for 
Did you mean: 

Calculations for the Time Difference on the same Day

Former Member
0 Kudos

Hi All,

I have two time values for a given day for e.g, 8:32 AM and 4:32 PM(16:25). I need to calculate the difference in minutes.The calculation would be

[(16*60)+25] -[(8*60)+32]. Please help me build this formula in webi.

we are using BO 4.1 and Sybase IQ database.

Thanks for your efforts.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member207878
Active Participant
0 Kudos

Is it in Date format or you just have it as String???

jyothirmayee_s
Active Contributor
0 Kudos

Hi,

Code provided would be helpful.

***1st Variable:

=(

(

(

ToNumber( Substr( FormatDate( [Most recent timestamp]

;"HH:mm:ss" ) ; 1 ; 2 ) ) * 60 * 60 +

ToNumber( Substr( FormatDate( [Most

recent timestamp] ;"HH:mm:ss" ) ; 4 ; 2 ) ) * 60 +

ToNumber( Substr(

FormatDate( [Most recent timestamp] ;"HH:mm:ss" ) ; 7 ; 2 ) )

)

****and another variable:

(

ToNumber( Substr( FormatDate( [Oldest timestamp] ; "HH:mm:ss" ) ; 1 ;2 ) ) *

60 * 60 +

ToNumber( Substr( FormatDate( [Oldest timestamp] ; "HH:mm:ss" ) ;

4 ; 2) ) * 60 +

ToNumber( Substr( FormatDate( [Oldest timestamp] ;

"HH:mm:ss" ) ; 7 ; 2) )

)

)

)

*** Create 3rd Variable including above 2 variables:

60 +

( DaysBetween( [Oldest

timestamp] ; [Most recent timestamp] ) * 24 * 60 )

Below is the link for your review.

calculate difference between two times in webi

Thanks,

Jothi