F_ADDDAY

<< F_ADDWEEK | IBExpert UDF Functions | F_ADDHOUR >>

F_ADDDAY

 

substitutable with DATEADD

  • function from adhoc
  • Compatible with UTF-8
  • Input TIMESTAMP date optionally time, INTEGER days to add
  • Output TIMESTAMP adds days to timestamp

If parameter 2 is negative, days to subtract.

Example

 select cast('04.10.2018 15:03:01' as timestamp) as ISCORRECT, F_ADDDAY('01.10.2018 15:03:01', 3)
 from RDB$DATABASE
 union
 select cast('28.09.2018 15:03:01' as timestamp) as ISCORRECT, F_ADDDAY('01.10.2018 15:03:01', -3)
 from RDB$DATABASE
 union
 select null as ISCORRECT, F_ADDDAY(null, null)
 from RDB$DATABASE;

Expected results:

                 ISCORRECT
 ========================= =========================
                    <null>                    <null>
 2018-09-28 15:03:01.0000  2018-09-28 15:03:01.0000
 2018-10-04 15:03:01.0000  2018-10-04 15:03:01.0000

back to top of page
<< F_ADDWEEK | IBExpert UDF Functions | F_ADDHOUR >>