How to convert week number and weekday to date

I have to fields, consisting of
* Week number
* Weekday

How can I find the date?
jarlebergeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
hnasrConnect With a Mentor Commented:
' hi jarleberge

yourDate=DateAdd("w";1;DateAdd("ww";12-1;#01/01/2000#))

in general: using values from a table or controls on a form:

theDate= DateAdd("w";[theWeekday];DateAdd("ww";[theWeek]-1;#01/01/2000#))
0
 
TivilioCommented:
I did not understand quite well...

Do you mean you have for example:

Week Number = 12
Weekday = Monday

and you wanna get 3/20/2000 ?

Is that what you want ?
0
 
jarlebergeAuthor Commented:
Thats correct, but the weekday should be the weekday number.

Ex.
Week Number = 12
Weekday number = 1

and I would have 3/20/2000
0
 
Yury_DelendikCommented:
If Sunday = 7

SELECT DateAdd("ww",[Week],DateAdd("d",[WeekDay]-DatePart("w",#1/1/2000#,2),#1/1/2000#)) AS Expr
FROM Table1;

If Sunday = 0

SELECT DateAdd("ww",[Week],DateAdd("d",[WeekDay] + 1 - DatePart("w",#1/1/2000#,1),#1/1/2000#)) AS Expr
FROM Table1;

0
 
TivilioCommented:
Yes, I have been prooving hnasr´s solution, and I think it works properly, but you got to add 1 to the weekday if your weekday starts on 1 for Monday and ends on 7 for Sunday, as I show you.

theDate= DateAdd("w";[theWeekday]+1;DateAdd("ww";[theWeek]-1;#01/01/2000#))
0
All Courses

From novice to tech pro — start learning today.