Create List of Dates that fall between 2 Dates

D

Diggsy

Hello,
I am tyrying to create a query that will list All the dates between two
dates. For instance I have the Date January 1 in the Start Field and have
January 3 in the End Field.

Name Start Date End Date
Bob 01/01/09 01/03/09

I would like the result

Bob 01/01/09
Bob 01/02/09
Bob 01/03/09
Any suggestions would be greatly appreciated

thanks

Chris
 
D

Duane Hookom

I would create a table of numbers with a single field and then add values
from 0 to whatever number:

tblNums
=====
[Num]
0
1
2
3
4

Add this into a query with your table containing Start and End fields.
Create a column with this expression:
NewDate: Start + Num
Set the criteria under this column to
Between [Start] and [End]

This should return the appropriate dates.
 
D

Diggsy

Thank you so much for your help

Duane Hookom said:
I would create a table of numbers with a single field and then add values
from 0 to whatever number:

tblNums
=====
[Num]
0
1
2
3
4

Add this into a query with your table containing Start and End fields.
Create a column with this expression:
NewDate: Start + Num
Set the criteria under this column to
Between [Start] and [End]

This should return the appropriate dates.

--
Duane Hookom
Microsoft Access MVP


Diggsy said:
Hello,
I am tyrying to create a query that will list All the dates between two
dates. For instance I have the Date January 1 in the Start Field and have
January 3 in the End Field.

Name Start Date End Date
Bob 01/01/09 01/03/09

I would like the result

Bob 01/01/09
Bob 01/02/09
Bob 01/03/09
Any suggestions would be greatly appreciated

thanks

Chris
 

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