From: Peeters on
given: weeknumber and year
I want to know :
the date of the sunday (1st day of week) of the given weeknumber
the date of the saturday (7th day of week) of the given weeknumber

Is there anyone who can give me vba code for such functions?

tks
Michel
From: vanderghast on
Given any date, assuming weeks run from Sunday to Saturday, its Sunday is

x + 1 - DatePart("w", x)

and its Saturday is

x + 7 - DatePart("w", x)


To get a date in the n-th week of the year ( n >= 1 ):

dateadd( "ww", n-1, dateSerial( 2010, 1, 1))


which become the "x" in the previous expression(s).

(That assumes that the first of January is in the first week of the year,
not necessary a convention which is right everywhere).


Vanderghast, Access MVP


"Peeters" <michel.melsbroek(a)gmail.com> wrote in message
news:8c47561e-43d0-4dcb-956f-9598757db07e(a)z11g2000yqz.googlegroups.com...
> given: weeknumber and year
> I want to know :
> the date of the sunday (1st day of week) of the given weeknumber
> the date of the saturday (7th day of week) of the given weeknumber
>
> Is there anyone who can give me vba code for such functions?
>
> tks
> Michel