F_AGEINWEEKSISO

<< F_AGEINWEEKS | IBExpert UDF Functions | F_AGEINWEEKSN >>

F_AGEINWEEKSISO

 
  • 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) weeks between timestamp 1 and timestamp 2

if you want a negative number if the first date is newer than the second date. ISO-version of F_AGEINWEEKS. Monday is 1st day of week. If the two dates are in the same week, the return value is 0.

Example

 SELECT 19 AS ISCORRECT, F_AGEINWEEKSISO('01.06.2018 15:01:21','15.10.2018 15:01:21') FROM RDB$DATABASE;

Expected results:

    ISCORRECT F_AGEINWEEKSISO
 ============ ===============
           19              19

Example

 SELECT -33 AS ISCORRECT, F_AGEINWEEKSISO('01.01.2019 15:01:21','15.05.2018 15:01:21') FROM RDB$DATABASE;

Expected results:

    ISCORRECT F_AGEINWEEKSISO
 ============ ===============
          -33             -33

back to top of page
<< F_AGEINWEEKS | IBExpert UDF Functions | F_AGEINWEEKSN >>