DATE TIME VARIABLE

HELLO
I have a report where i have to subtract two date-time fields and store it in a variable.So i have used daysbetween() function but this gives me number but the output required is in below format

1 Month 24 Days 4 Hours

So can any one please suggest some solution.
I have creted a variable C which has the formula Daysbetween(A-B)
where A & B are date time fields.please help.

Please answer as soon as possible.

thank you


divesh_gao (BOB member since 2012-06-11)

This variable will get you to minutes. From there, you will need other variables to get you Month/Days/Hours. I hope this helps:

=(((DaysBetween([First Date];[Second Date])*1440)+(ToNumber(Substr(FormatDate([Second Date] ;"HH:mm:ss") ;1 ;2)) - ToNumber(Substr(FormatDate([First Date] ;"HH:mm:ss") ;1 ;2)))*60 +(ToNumber(Substr(FormatDate([Second Date];"HH:mm:ss") ;4 ;2)) - ToNumber(Substr(FormatDate([First Date] ;"HH:mm:ss") ; 4 ; 2)))))

[Moderator Edit: Added code formatting - Andreas]


msayer (BOB member since 2010-08-31)

go it


divesh_gao (BOB member since 2012-06-11)