# Thread: the 53rd week? (Access 97 (SP2))

1. ## the 53rd week? (Access 97 (SP2))

Why oh why would Access calculate Monday of this week as the 53rd week of 2002? <img src=/S/bouncenburn.gif border=0 alt=bouncenburn width=31 height=31> . I just had to redo a bunch of queries to produce a report that captures this week (53rd) and last week (the 52nd) based on today's date.

Also, don't you think there should be an error message if the query is subtracting 1 from week(date) resulting in "0, 2003"? <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22>

Short of banning anyone from working the last three days of 2003, does anyone have a better solution here?

2. ## Re: the 53rd week? (Access 97 (SP2))

It calculates it that way because that's what it works out to. And the 0 week is a partial week at the start of the year. Using week numbers is not tidy because years rarely start on the designated first day of the week for your system. If you explain exactly why you're trying to do, maybe someone can help. If you work with week numbers, they inevitably run into this condition, so you have to work around it.

3. ## Re: the 53rd week? (Access 97 (SP2))

A year can have more than 52 weeks! It depends on what is defined as the first day of a week.
eg. The week starts on a sunday. Saturday the 1st is in week 1. Sunday the 2nd is already in week 2.
If you want the first week to start on 1.1 then you will have to write your own function to convert a given date into your desired week.

4. ## Re: the 53rd week? (Access 97 (SP2))

'Also, don't you think there should be an error message if the query is subtracting 1 from week(date) resulting in "0, 2003"?'

The returned value is what you programmed. Why should the system give you a warning, it's doing what you requested it to do.

I learnt a long time ago that computers do what you tell them to NOT what you want them to. It's up to you to write code that works the way you want it to and test, test, TEST...

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•