At 11:39 AM 4/29/2016, Bruce Chitiea wrote:

For anyone who might need it:

The topic of calculating shift time across midnight boundaries came up in early
March.

Albert Berry introduced DATETIME math, inspiring replacement of my complicated
[ Day1Hours + DaysBetween + LastDayHours ] code with:

SET VAR vDateTime_PREV = (DATETIME(.vDate_PREV , .vTime_PREV ))
SET VAR vDateTime_CURR = (DATETIME(.vDate_CURR , .vTime_CURR ))

SET VAR vElapsed_SECONDS   = (.vDateTime_CURR - .vDateTime_PREV )
SET VAR vElapsed_Dec_HOURS = (ROUND((.vElapsed_SECONDS / 3600),3))
SET VAR vElapsed_Dec_DAYS  = (ROUND((.vElapsed_Dec_HOURS/24),3))
SET VAR vElapsed_Cal_DAYS  = (.vDate_CURR - .vDate_PREV )


Using R:BASE X Enterprise (Version 10) ....

Application: Calculating Time Lapse - R:BASE X Enterprise

http://www.razzak.com/sampleapplications

Have fun!

Razzak.



--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to