Sivasan
asked on
Finding the beginning date of next 11 weeks including current week in access query
Hi there,
I'm trying to find the begging date of a week for 11 weeks including the current week.
Example now we are on the 40 week of the year and the date for the start of the 40 week is 9/28/2014
I would like to get the beginning date for the next 10 weeks including current weeks start date
I'm able to get current weeks using DateAdd("d",(CInt(Format(D ate(),"w") )-1)*-1,Da te()) not sure how I can get the next 10 weeks start date. I would appreciate any help.
thanks
I'm trying to find the begging date of a week for 11 weeks including the current week.
Example now we are on the 40 week of the year and the date for the start of the 40 week is 9/28/2014
I would like to get the beginning date for the next 10 weeks including current weeks start date
I'm able to get current weeks using DateAdd("d",(CInt(Format(D
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I use a table (tbl_Numbers) for stuff like that. It only has one field (intNumber) and 10 records (the values 0-9). With that, I can create a query (qry_Numbers) to generate as many consecutive numbers as I want, like:
SELECT Tens.intNumber * 10 + Ones.intNumber as intNumber
FROM tbl_Numbers as Tens, tbl_Numbers as Ones
With that query you could do something like:
SELECT Dateadd("ww", intNumber, dateadd("d", -weekday(date, vbmonday), date())) as WeekStart
FROM qry_Numbers
WHERE intNumber <= 11
SELECT Tens.intNumber * 10 + Ones.intNumber as intNumber
FROM tbl_Numbers as Tens, tbl_Numbers as Ones
With that query you could do something like:
SELECT Dateadd("ww", intNumber, dateadd("d", -weekday(date, vbmonday), date())) as WeekStart
FROM qry_Numbers
WHERE intNumber <= 11
ASKER
Thank you