Convert minutes to days

Hi there,
I have this Webi formula that converts the difference between two time fields in minutes. How do i change it so that it converts to days?

=((DaysBetween([Order Made Dttm];[Begin Procedure Time]) * 86400 + (ToNumber(FormatDate([Order Made Dttm];"HH")) * 3600 + ToNumber(Left(FormatDate([Order Made Dttm] ;"mm:ss");2)) * 60 + ToNumber(FormatDate([Order Made Dttm] ;"ss"))) - (ToNumber(FormatDate([Begin Procedure Time];"HH")) * 3600 + ToNumber(Left(FormatDate([Begin Procedure Time];"mm:ss");2)) * 60))/60

wdelaney (BOB member since 2011-07-06)

Well, if you can figure out how many minutes are in a day, you can divide by that number.

Or use the daysbetween function, which returns an integer value


Tom Thompson :us: (BOB member since 2003-06-04)

If I do DaysBetween([Order Made Dttm];[Begin Procedure Time]) and the time difference is only 15 minutes, I get 0 for days. This is because DaysBetween only displays an integer, no decimals.
How do I display the decimals? or, in this case, display the 15 minutes as 0.010416666666666666 days.


wdelaney (BOB member since 2011-07-06)

Sorry, must’ve had a typo. Tom Thompson is right, if you divide by 1440, the number of minutes in a day, then you get the correct answer which includes the answer

=Abs((DaysBetween([Order Made Dttm];[Begin Procedure Time]) * 86400 + (ToNumber(FormatDate([Order Made Dttm];“HH”)) * 3600 + ToNumber(Left(FormatDate([Order Made Dttm] ;“mm:ss”);2)) * 60 + ToNumber(FormatDate([Order Made Dttm] ;“ss”))) - (ToNumber(FormatDate([Begin Procedure Time];“HH”)) * 3600 + ToNumber(Left(FormatDate([Begin Procedure Time];“mm:ss”);2)) * 60))/60/1440)


wdelaney (BOB member since 2011-07-06)

…includes the decimals, not includes the answer


wdelaney (BOB member since 2011-07-06)