# Formula for time btwn dates worked b4, now incorrect. Help?

I have a variable ([Run Time]) that’s supposed to show the number of hours between when an order was written (for the sake of brevity I’ll call that [A]) and current time ([B]). This is my current formula:

``````=(((DaysBetween([A];[B]))*1440)
+(ToNumber(Substr(FormatDate([B];"HH:mm:ss");1 ;2))
-ToNumber(Substr(FormatDate([A];"HH:mm:ss");1 ;2)))*60
+(ToNumber(Substr(FormatDate([B];"HH:mm:ss");4 ;2))
-ToNumber(Substr(FormatDate([A];"HH:mm:ss");4 ;2))))/60
``````

First, can you confirm that the formula looks OK? If there’s a simpler way to do that I’ll take it.

Here’s the frustrating part: It’s been working just fine. It worked correctly when I ran the report at 1:06pm today. But when I ran it at 4:18, the calculations were off. If the formula is correct, is there anything that could’ve happened on the back end to affect the results?

It’s currently 12/15/2015 17:36, and my report is showing [Run Time] for an order written at 12/14/2015 17:25 is 48 hours, when it should be 24.
I did double check =CurrentDate() and it’s correctly displaying the current date, & time when I format it to do so.

thriftjl (BOB member since 2014-11-07)

Check this -

aniketp (BOB member since 2007-10-05)

Thank you, but those formulas are doing the same thing my formula, above, does.

To be more clear, I’m only looking for new formulas to use if someone sees something explicitly wrong with the one I’m using. I’ve used mine in previous reports and it’s always been perfectly accurate, so I don’t want to muck things up trying new formulas unless there’s a good explanation for why my current one doesn’t work.

My primary question is what could possibly be causing my usual formula to calculate incorrectly? Could it have something to do with the fact that I’m using CurrentDate() rather than a date object?

thriftjl (BOB member since 2014-11-07)