F_AGEINYEARS

<< F_SUBPERIOD | IBExpert UDF Functions | F_AGEINYEARSN >>

F_AGEINYEARS

 

substitutable with DATEDIFF

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

if you want a negative number if the first date is newer than the second date

Example

 SELECT 4 AS ISCORRECT, F_AGEINYEARS('12.12.2014', '17.12.2018') FROM RDB$DATABASE;

Expected results:

    ISCORRECT F_AGEINYEARS
 ============ ============
            4            4

Example

 SELECT -5 AS ISCORRECT, F_AGEINYEARS('12.12.2018', '12.12.2013') FROM RDB$DATABASE;

Expected results:

    ISCORRECT F_AGEINYEARS
 ============ ============
           -5           -5

back to top of page
<< F_SUBPERIOD | IBExpert UDF Functions | F_AGEINYEARSN >>