Link to home
Start Free TrialLog in
Avatar of Sivasan
SivasanFlag for United States of America

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(Date(),"w"))-1)*-1,Date())   not sure how I can get the next 10 weeks start date. I would appreciate any help.
thanks
ASKER CERTIFIED SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sivasan

ASKER

Yep, my bad, had the answer.
Thank you
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