F_AGEINMONTHS

<< F_AGEINYEARSN | IBExpert UDF Functions | F_AGEINMONTHSN >>

F_AGEINMONTHS

 

substitutable with DATEDIFF

  • compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
  • Compatible with UTF-8
  • Input TIMESTAMP (older) date optionally time 1, TIMESTAMP (newer) date optionally time 2
  • Output INTEGER difference in (integer) months between timestamp 1 and timestamp 2

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

Example

 SELECT 11 AS ISCORRECT, F_AGEINMONTHS('12.01.2018', '12.12.2018') FROM RDB$DATABASE;

Expected results:

    ISCORRECT F_AGEINMONTHS
 ============ =============
           11            11

Example

 SELECT -11 AS ISCORRECT, F_AGEINMONTHS('12.12.2018', '12.01.2018') FROM RDB$DATABASE;

Expected results:

    ISCORRECT F_AGEINMONTHS
 ============ =============
          -11           -11

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