Need table of all dates between two other dates as input to another query

B

Benjamin White

I have been googling just for this one, supposedly simple task for most of
the evening. Is there any relatively simple way of doing this? I need the
table to contain all the dates between two specified in a form, not just
ones already in an existing table.

Thanks, Nibjib
 
J

John Vinson

I have been googling just for this one, supposedly simple task for most of
the evening. Is there any relatively simple way of doing this? I need the
table to contain all the dates between two specified in a form, not just
ones already in an existing table.

Thanks, Nibjib

I'd suggest just creating a table with 20 years of dates (it's easy to
use Excel to "fill down" starting with the first date you'll need, and
fill down as many rows as you like). This spreadsheet can then be
imported into Access.

A Query on this table with criteria

[datefield] >= CDate([Forms]![yourform]![datefrom]) AND [datefield] <=
CDate([Forms]![yourform]![dateto])

will give you all dates in the range, and the table is relatively tiny
(7305 rows).
 

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