Solved

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

Posted on 2014-10-03
3
204 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

813 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