I am developing an application in APEX and need to determine the pay period based on an entered date. Our pay periods are 14 days and pay period 1 starts after the last pay period from the year before that started any day in December (so for this year, pay period 1 started on January 11 because the last pay period in 2014 started December 28 and went to January 10). Some years we have 26 pay periods and some years we have 27. Does anyone have ideas on how to extract the Pay Period number for something like this using PL/SQL?