Week number to Monday of week

C

Corrine

I have a query from a Sharepoint list. The work week number is listed in a
column for text in a single line (just a two digit number). I would like to
query it in Access and find out what Monday's date for that work week would
be. Any suggestions would be helpful. (The users prefer to use work week
number)

thank you.
 
M

MGFoster

Corrine said:
I have a query from a Sharepoint list. The work week number is listed in a
column for text in a single line (just a two digit number). I would like to
query it in Access and find out what Monday's date for that work week would
be. Any suggestions would be helpful. (The users prefer to use work week
number)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This formula will work if the week is in the current year (all on one
line):

DateAdd("ww",36-1,DateSerial(Year(Date()),1,1)) -
(WeekDay(DateAdd("ww",36-1,DateSerial(Year(Date()),1,1))) - vbMonday)

If the year is not the current year change the "Year(Date())" part of
the formula to "Year(THE YEAR NUMBER)." Substitute your year number or
a variable or a column (Field) name for "THE YEAR NUMBER."

Sometimes the intrinsic constants don't work in a query. If this
happens (the query returns the wrong value) you can change vbMonday to
the number 2.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSqGWDoechKqOuFEgEQIS6gCeNN58v+QNd78bUa0cx8p+tDoS7SMAoO9W
ZP/dJaht2Q0KOO2+HMkfTAkt
=RuXW
-----END PGP SIGNATURE-----
 
C

Corrine

Thank you for your help. Our first work week of the year starts on December
28th (2008) and it looks like you have it coded to start in August. Here are
the results of the query...
WW Monday
22 9/20/09
35 10/3/09
01 08/30/09
34 10/2/09
36 10/4/09

Any suggestions?
 
C

Corrine

I played with it some more and got the answer I needed. Thank you for your
assistance.
 
Top