# 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)