Bruce,
Did you know that you can use the RTimeLapse
Plugin to calculate the most accurate elapsed
time, including Days, Hours, and Minutes?
RTimeLapse is part of RBASEPluginPowerPackX5 Plugin.
-- Example:
SET VAR vStartDate DATE = NULL
SET VAR vStartTime TIME = NULL
SET VAR vEndDate DATE = NULL
SET VAR vEndTime TIME = NULL
SET VAR vRBTIDays INTEGER = NULL
SET VAR vRBTIHours INTEGER = NULL
SET VAR vRBTIMins INTEGER = NULL
SET VAR vCommand TEXT = NULL
SET VAR vResult TEXT = NULL
SET VAR vStartDate = (ADDDAY(.#DATE,-1))
SET VAR vStartTime = (ADDMIN(.#TIME,-90))
SET VAR vEndDate = (.#DATE)
SET VAR vEndTime = (.#TIME)
SET VAR vCommand = +
('PLUGIN RTimeLapse vResult' + +
'|START_DATE'&(CTXT(.vStartDate)) + +
'|START_TIME'&(CTXT(.vStartTime)) + +
'|STOP_DATE '&(CTXT(.vEndDate)) + +
'|STOP_TIME '&(CTXT(.vEndTime)))
&vCommand
RETURN
-- Notice the resulting vRBTIDays, vRBTIHours,
and vRBTIMins variables as follows:
SHOW VARIABLES
vStartDate = 07/13/2020 DATE
vStartTime = 09:48 PM TIME
vEndDate = 07/14/2020 DATE
vEndTime = 11:18 PM TIME
vRBTIDays = 1 INTEGER
vRBTIHours = 1 INTEGER
vRBTIMins = 30 INTEGER
That's all there is to it.
Very Best R:egards,
Razzak
At 07:41 PM 7/14/2020, Bruce Chitiea wrote:
I've been hunting for a simple function to
convert a TIME value (e.g. 10:15) to a REAL
value (e.g. 10.25), to make "elapsed time math" easy.
Something like:Â (DTIME(.vTimeValue))Â ... which I'm not seeing.
This would reduce elapsed-TIME calculations to:
SET VAR vTime_End_DOUBLE =Â (DTIME(.vTime_End_TIME))
SET VAR vTime_Beg_DOUBLE =Â (DTIME(.vTime_Beg_TIME))
SET VAR vTime_Elapsed_DOUBLE = (.vTime_End_DOUBLE - .vTime_Beg_DOUBLE)
I'm absolutely sure I'm just missing something
insanely simple. Meanwhile, something like
Footnote [1] does the job, but forget about
putting it in a Calculated Column Definition,
which is the best place for such a basic calculation.
Thanks, Bruce
Bruce A. Chitiea
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/0MQ4Bx-1jzeY40Fil-005J08%40mrelay.perfora.net.