F_AGEINWORKINGDAYSTHRESHOLD

<< F_AGEINDAYSTHRESHOLDN | IBExpert UDF Functions | F_AGEINHOURSTHRESHOLD >>

F_AGEINWORKINGDAYSTHRESHOLD

 
  • compatibility to FreeUDFLib, FreeUDFLib AvERP
  • Compatible with UTF-8
  • Input TIMESTAMP (older) date optionally time 1, TIMESTAMP (newer) date optionally time 2, INTEGER min. value, INTEGER min. value is used (0 = no, 1 = yes), INTEGER max. value, INTEGER max. value is used (0 = no, 1 = yes, INTEGER weekday don't calculate)
  • Output INTEGER difference in (integer) days between timestamp 1 and timestamp 2 less of weekday/s from param 7


weekday: Monday = 1, Thuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7 If 1st date is newer than 2nd date, the result is negativ. Any order of indexes for weekdays. Only allowed indexes are calculated.

Example

 select 4 as ISCORRECT, F_AGEINWORKINGDAYSTHRESHOLD('12.12.2008', '17.12.2008', 5, 0, 0, 0, 7)
 from RDB$DATABASE
 union
 select 5 as ISCORRECT, F_AGEINWORKINGDAYSTHRESHOLD('12.12.2008', '17.12.2008', 5, 1, 0, 0, 7)
 from RDB$DATABASE
 union
 select 4 as ISCORRECT, F_AGEINWORKINGDAYSTHRESHOLD('12.12.2008', '17.12.2008', 0, 0, 3, 0, 7)
 from RDB$DATABASE
 union
 select 3 as ISCORRECT, F_AGEINWORKINGDAYSTHRESHOLD('12.12.2008', '17.12.2008', 0, 0, 3, 1, 7)
 from RDB$DATABASE
 union
 select null as ISCORRECT, F_AGEINWORKINGDAYSTHRESHOLD(null, null, null, null, null, null, null)
 from RDB$DATABASE;

Expected results:

    ISCORRECT
 ============ ============
       <null>       <null>
            3            3
            4            4
            5            5

back to top of page
<< F_AGEINDAYSTHRESHOLDN | IBExpert UDF Functions | F_AGEINHOURSTHRESHOLD >>