Week of year

  • Thread starter Thread starter Donagh Berry
  • Start date Start date
D

Donagh Berry

hi all,
I have a column with dates across several years. I want to get the
week of the year corresponding to each date. However, I'm noticing
that with each year the number of days in the first week decreases by
one. (i.e., in my first year 1995, the first 7 days belong to week one
while in the second year 1999, the 7th day belongs to week two). Is
there any way to get around this such that the first week of each year
has 7 days??

Thanks in advance
donagh
 
Check Access VB Help on the different arguments of the Format Function.
There is the "firstweekofyear" argument you can use to specify your choice
of week 1.
 
If you mean you want the year divided into 7 day increments (and not calendar
weeks) then you could use the following function.

(DatePart("y",YourDateField)-1)\7

That should return
1 for the first 7 days of the year
2 for the 8th to 14th day
3 for the 15th to 21st day etc.

Note that you will end up with 53 for the 365th and 366th day of the year.

I am assuming that you are using the DatePart Function which has several options
 
Back
Top