Date Ranges

M

Michael Comtois

I need to know how i can be prompted to enter a date range
and then have a table created with all the dates in the
range???

Ex:

Enter Start Date: 1/1/2004
Enter End Date: 1/5/2004

run make table that outputs:

Date
------
1/1/2004
1/2/2004
1/3/2004
1/4/2004
1/5/2004

Any help would be great!! Thanks!

-Mike
 
J

John Vinson

I need to know how i can be prompted to enter a date range
and then have a table created with all the dates in the
range???

Ex:

Enter Start Date: 1/1/2004
Enter End Date: 1/5/2004

run make table that outputs:

Date
------
1/1/2004
1/2/2004
1/3/2004
1/4/2004
1/5/2004

You'll need an auxiliary table, AllDates, with one date/time field
containing every date in any range you'll ever need. This can be
created most easily in Excel - fill cell A1 with the earliest relevant
date, A2 with the next day, and then use "Fill Down" to fill 10000
rows or so (be generous). Copy and paste - or, better, link to and
append - this to an Access table.

You can now create a query with criteria

BETWEEN [Enter start date:] AND [Enter end date:]

on this table to pull up the dates in a range. It's probably neither
wise nor necessary to create a separate table for just a specific
range.

John W. Vinson[MVP]
(no longer chatting for now)
 
Top