Date Query

  • Thread starter Thread starter Peter Hack
  • Start date Start date
P

Peter Hack

Hi,

I have a table with two fields - Start Date and End Date. I would like to
write a query that returns all the dates in-between those two dates,
including the start and end date.

Thanks in advance for any help.
 
Hi,

I have a table with two fields - Start Date and End Date. I would like to
write a query that returns all the dates in-between those two dates,
including the start and end date.

Thanks in advance for any help.

An auxiliary table can be helpful here. I routinely add a table Num
with one Long Integer field N, with values from 0 to 10000 or so.

Create a Query with your table and Num, with no join line. Include any
desired fields from your table, and also include N, with a criterion
of

<= DateDiff("d", [Start Date], [End Date])

and a calculated field

Newdate: DateAdd("d", [N], [Start Date])

You can then use this Query however you like - as an append or
make-table query, for export, or for Reports or Forms.
 
Back
Top