F_LASTDAYKW

<< F_FIRSTDAYKW | IBExpert UDF Functions | F_FIRSTDAYLASTQUARTER >>

F_LASTDAYKW

 
  • function from adhoc
  • Compatible with UTF-8
  • Input INTEGER week number, INTEGER year
  • Output TIMESTAMP Date with last day of (ISO)week of the year as date with time 00:00:00

Example

 SELECT '03.01.2016' AS ISCORRECT, F_LASTDAYKW(53, 2015) FROM RDB$DATABASE;

Expected results:

 ISCORRECT                F_LASTDAYKW
 ========== =========================
 03.01.2016 2016-01-03 00:00:00.0000

Example

 SELECT '10.01.2016' AS ISCORRECT, F_LASTDAYKW(1, 2016) FROM RDB$DATABASE;

Expected results:

 ISCORRECT                F_LASTDAYKW
 ========== =========================
 10.01.2016 2016-01-10 00:00:00.0000

Example

 SELECT '06.05.2018' AS ISCORRECT, F_LASTDAYKW(18, 2018) FROM RDB$DATABASE;

Expected results:

 ISCORRECT                F_LASTDAYKW
 ========== =========================
 06.05.2018 2018-05-06 00:00:00.0000

Example

 SELECT '01.04.2018' AS ISCORRECT, F_LASTDAYKW(13, 2018) FROM RDB$DATABASE;

Expected results:

 ISCORRECT                F_LASTDAYKW
 ========== =========================
 01.04.2018 2018-04-01 00:00:00.0000

Example

 SELECT NULL AS ISCORRECT, F_LASTDAYKW(NULL, NULL) FROM RDB$DATABASE;

Expected results:

 ISCORRECT              F_LASTDAYKW
 ========= =========================
 <null>                       <null>

back to top of page
<< F_FIRSTDAYKW | IBExpert UDF Functions | F_FIRSTDAYLASTQUARTER >>