Multiple Date Records

B

Bill

Hi,
I need help, but don’t we all. What I need is. How can I use a query to find
multiple dates from a table?
My start date will be 08/05/2009, the next date will be 7 days before
original date of 08/05/2009 (07/29/2009) , then 7 days before 07/29/2009 and
continue till end of the gmDate column or I enter a stop date.
Thanks,
Bill
 
A

Al Campagna

Bill,
Given this data in tblTest...
TestDate
1/1/2009
1/2/2009
1/3/2009
1/4/2009
1/5/2009
1/6/2009
1/7/2009
1/8/2009
9/1/2009
10/1/2009
Given this query...
SELECT tblTest.TestDate, Weekday([TestDate]) AS WkDay
FROM tblTest WHERE (((tblTest.TestDate) Between
NZ([StartDate],#1/1/1990#) AND
NZ([EndDate],#1/1/2020#)) AND
((Weekday([TestDate]))=Weekday([EndDate])));
Given StartDate = 1/1/09 and EndDate = 10/1/09 yields...
TestDate WkDay
1/1/2009 5
1/8/2009 5
10/1/2009 5
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
L

Lynn Trapp

Take a look at the DateAdd() function.

Select YourDateField
From Your Table
Where YourDateField = #8/05/2009#
Or YourDateField = DateAdd("d",-7,#8/05/2009#)
Or YourDateField = DateAdd("d",-14,#8/05/2009#);

That should get you started.
 
K

KARL DEWEY

Create a table named CountNumber with field CountNUM containing numbers 0
(zero) through your maximum.
Use this query --
SELECT DateAdd("d", -[CountNUM]*7, [Start_Date])
FROM YourTable, CountNumber
WHERE CountNUM Between 0 AND [Enter Spread];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top