F_FIRSTDAYLASTMONTH

<< F_LASTDAYLASTQUARTER | IBExpert UDF Functions | F_LASTDAYLASTMONTH >>

F_FIRSTDAYLASTMONTH

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

Example

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

Expected results:

 ISCORRECT        F_FIRSTDAYLASTMONTH
 ========== =========================
 01.12.2018 2018-12-01 00:00:00.0000

Example

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

Expected results:

 ISCORRECT        F_FIRSTDAYLASTMONTH
 ========== =========================
 01.01.2019 2019-01-01 00:00:00.0000

back to top of page
<< F_LASTDAYLASTQUARTER | IBExpert UDF Functions | F_LASTDAYLASTMONTH >>