F_LASTDAYLASTMONTH

<< F_FIRSTDAYLASTMONTH | IBExpert UDF Functions | F_FIRSTDAYLASTWEEK >>

F_LASTDAYLASTMONTH

 
  • function from adhoc
  • Compatible with UTF-8
  • Input TIMESTAMP date optionally time
  • Output TIMESTAMP date of last day of last month as date with time 00:00:00

Example

 SELECT '31.12.2018' AS ISCORRECT, F_LASTDAYLASTMONTH('27.01.2019 15:00:00') FROM RDB$DATABASE;

Expected results:

 ISCORRECT        F_LASTDAYLASTMONTH
 ========== =========================
 31.12.2018 2018-12-31 00:00:00.0000

Example

 SELECT '31.01.2019' AS ISCORRECT, F_LASTDAYLASTMONTH('27.02.2019 15:00:00') FROM RDB$DATABASE;

Expected results:

 ISCORRECT        F_LASTDAYLASTMONTH
 ========== =========================
 03.01.2019 2019-01-31 00:00:00.0000

back to top of page
<< F_FIRSTDAYLASTMONTH | IBExpert UDF Functions | F_FIRSTDAYLASTWEEK >>