F_INDMINUTESBETWEENTHR

<< F_INDMINUTESBETWEEN | IBExpert UDF Functions | F_INDMINUTESBETWEENTHRIB >>

F_INDMINUTESBETWEENTHR

 
  • function from adhoc
  • Compatible with UTF-8
  • Input TIMESTAMP (older) date optionally time 1, TIMESTAMP (newer) date optionally time 2, TIME min. value, INTEGER min. value is used (0 = no, 1 = yes), TIME max. value, INTEGER max. value is used (0 = no, 1 = yes)
  • Output INTEGER difference in (integer) industryminutes between timestamp 1 and timestamp 2

Example

 select 800 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 07:55:00', '08.11.2018 16:05:00', '08:00', 1, '16:00', 1)
 from RDB$DATABASE
 union
 select 808 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 07:55:00', '08.11.2018 16:05:00', '08:00', 0, '16:00', 1)
 from RDB$DATABASE
 union
 select 808 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 16:05:00', '08.11.2018 07:55:00', '08:00', 0, '16:00', 1)
 from RDB$DATABASE
 union
 select 817 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 07:55:00', '08.11.2018 16:05:00', '08:00', 0, '16:00', 0)
 from RDB$DATABASE
 union
 select 817 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 07:55:00', '08.11.2018 16:05:00', '00:00', 0, '00:00', 0)
 from RDB$DATABASE
 union
 select 817 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 07:55:00', '08.11.2018 16:05:00', null, null, null, null)
 from RDB$DATABASE
 union
 select 817 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 16:05:00', '08.11.2018 07:55:00', null, null, null, null)
 from RDB$DATABASE
 union
 select 800 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 21:55:00', '09.11.2018 06:05:00', '22:00', 1, '06:00', 1)
 from RDB$DATABASE
 union
 select 808 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 21:55:00', '09.11.2018 06:05:00', '22:00', 1, '06:00', null)
 from RDB$DATABASE
 union
 select 800 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 07:55:00', '08.11.2018 16:05:00', '08:00', 1, '16:00', 1)
 from RDB$DATABASE
 union
 select 808 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 07:55:00', '08.11.2018 16:05:00', '08:00', 0, '16:00', 1)
 from RDB$DATABASE
 union
 select 817 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 07:55:00', '08.11.2018 16:05:00', '08:00', 0, '16:00', 0)
 from RDB$DATABASE
 union
 select 818 as ISCORRECT, F_INDMINUTESBETWEENTHR('08.11.2018 07:55:00', '08.11.2018 16:05:30', '08:00', 0, '16:00', 0)
 from RDB$DATABASE;

Expected results:

    ISCORRECT
 ============ ============
          800          800
          808          808
          817          817
          818          818

back to top of page
<< F_INDMINUTESBETWEEN | IBExpert UDF Functions | F_INDMINUTESBETWEENTHRIB >>