Quantcast
Channel: SCN : Popular Discussions - SAP BusinessObjects Desktop Intelligence
Viewing all articles
Browse latest Browse all 681

Calculate Date difference with time

$
0
0

Hi All,

 

I have 2 date fields like Date1 as "01/12/2009 10:20:00" and Date2 as "01/12/2009 11:20:00" here what I need is to have a variable in the report to calculate the time difference  like the diff should be  shown like 01:20:00 .

 

I am using MS access database and XI R2.

 

Please let me know the calculation .I use one some thing like this

 

=((ToNumber(SubStr(FormatDate(<Date1> ,"HH:mm:ss") ,1 ,2))*60*60 +ToNumber(SubStr(FormatDate(<Date1> ,"HH:mm:ss") ,4 

,2))*60+ToNumber(SubStr(FormatDate(<Date1> ,"HH:mm:ss") ,7 ,2))-ToNumber(SubStr(FormatDate(<Date2> ,"HH:mm:ss") ,1 

,2))*60*60+ToNumber(SubStr(FormatDate(<Date2> ,"HH:mm:ss") ,4 ,2))*60+ToNumber(SubStr(FormatDate(<Date2> ,"HH:mm:ss") ,7 ,2)))/3600)

 

 

Regards

Prashant


Viewing all articles
Browse latest Browse all 681

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>