meta data for this page
F_ADDPERIOD
function from adhoc
Entrypoint addperiod compatible with UTF-8
Inputs/Outputs
Input CSTRING(254) period 1 in pattern [d]:h:m:s CSTRING(254) period 2 in pattern [d]:h:m:s Output CSTRING(254) sum of period 1 and 2
Syntax
Periods could be entered with 2- or 1-digit intervals (dd:hh:mm:ss or d:h:m:s). Negative periods starts with a "-" in front. Periods with pattern days:hours:seconds (4 intervalls) or hours:minutes:seconds (3 intervalls) are allowed. The output of periods with less than 3 intervals or containing other characters is <null> or an empty string. For input also f.e. '0:26:0:0' instead of '1:2:0:0' allowed for 26 hours. The output is always in pattern days:hours:minutes:seconds (4 * 2 digit intervals) TestSQL SELECT '00:01:25:10' AS ISCORRECT, F_ADDPERIOD('0:1:10:0', '0:0:15:10') FROM RDB$DATABASE; SELECT '00:01:25:10' AS ISCORRECT, F_ADDPERIOD('01:10:00', '00:15:10') FROM RDB$DATABASE; SELECT '00:00:54:50' AS ISCORRECT, F_SUBPERIOD('0:1:10:0', '0:0:15:10'), F_ADDPERIOD('0:1:10:0', '-0:0:15:10') FROM RDB$DATABASE; SELECT NULL AS ISCORRECT, F_ADDPERIOD(NULL, NULL) FROM RDB$DATABASE;