F_DAYSBETWEEN

<< F_WEEKSBETWEENISO | IBExpert UDF Functions | F_WORKINGDAYSBETWEEN >>

F_DAYSBETWEEN

 
  • function from adhoc
  • Compatible with UTF-8
  • Input TIMESTAMP (older) date optionally time 1, TIMESTAMP (newer) date optionally time 2
  • Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2

Example

 select 10 as ISCORRECT, F_DAYSBETWEEN('01.10.2018 15:01:03', '11.10.2018 15:01:03')
 from RDB$DATABASE
 union
 select 20 as ISCORRECT, F_DAYSBETWEEN('21.10.2018 15:01:03', '01.10.2018 15:01:03')
 from RDB$DATABASE
 union
 select null as ISCORRECT, F_DAYSBETWEEN(null, null)
 from RDB$DATABASE;

Expected results:

    ISCORRECT
 ============ ============
       <null>       <null>
           10           10
           20           20

back to top of page
<< F_WEEKSBETWEENISO | IBExpert UDF Functions | F_WORKINGDAYSBETWEEN >>