Calculating SemiMonthly24, BiWeekly26, and Weekly52 Pay Periods

Home / Calculating SemiMonthly24, BiWeekly26, and Weekly52 Pay Periods

There are probably way more elegant ways to do this… but “Mission Accomplished”.

The gotcha in all of this is the biweekly (26 payments per year) schedule, because you need to know which week in a given month should be the chosen one. You can’t just assume it’s always the second week of a given month because the second week in that month may land on the first week of a month down the line. The SQL function below starts from a reference date with which it calibrates the start of the bi-weekly pay schedule and calculates the rest of the pay dates through the end date. Most organizations have a payroll system that calculates new pay dates from the last pay date of record (that’s the reference date here). The bottom line is an actual pay date of record must be known from which future pay dates can be calculated. The weekly (52 payments per year) and semi-monthly (24 payments per year) don’t have this problem, though the latter can have pay days that land on weekend days for which special handling is required… an aspect which is included in the T-SQL below.