F_AGEINWEEKSN

<< F_AGEINWEEKSISO | IBExpert UDF Functions | F_AGEINWEEKSNISO >>

F_AGEINWEEKSN

 
  • 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 <null> if the first date is newer than the second date.

Sunday is 1st day of week. If the two dates are in the same week, the return value is 0.

Example

 SELECT null AS ISCORRECT, F_AGEINWEEKSN('01.01.2019 15:01:21','15.05.2018 15:01:21') FROM RDB$DATABASE;

Expected results:

 ISCORRECT F_AGEINWEEKSN
 ========= =============
 <null>           <null>

back to top of page
<< F_AGEINWEEKSISO | IBExpert UDF Functions | F_AGEINWEEKSNISO >>