Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

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
0
Sivasan
Asked:
Sivasan
1 Solution
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Maybe I'm missing something... but wouldn't you just need to add multiples of 7 to the date for the current week?
0
 
SivasanAuthor Commented:
Yep, my bad, had the answer.
Thank you
0
 
Dale FyeCommented:
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
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now