Solved

Finding the beginning date of next 11 weeks including current week in access query

Posted on 2014-10-03
3
201 Views
Last Modified: 2014-10-03
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
Comment
Question by:Sivasan
3 Comments
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 500 total points
ID: 40360711
Maybe I'm missing something... but wouldn't you just need to add multiples of 7 to the date for the current week?
0
 

Author Comment

by:Sivasan
ID: 40360726
Yep, my bad, had the answer.
Thank you
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40360792
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now