create records between dates

tubar

Registered User.
Local time
Yesterday, 22:39
Joined
Jul 13, 2006
Messages
190
I have a table that lists events with a start and end date. Im having trouble coming up with a way I could duplicate these records in a report.
Example:
EVENT 1 3/15/18 – 3/20/18
EVENT 2 3/15/18 - 3/15/18

outputs
3/15 event 1 event 2
3/16 event 1
3/17 event 1
and so on

i imagine i have to do it with code because i have no luck doing it with a query.
 
there are steps you need to do in order
to get the resulting query that you need.

first is creating a Query based on Cartesian
of Tables.

we want to create Query against tblEvents (the main table).

firstly, create 3 tables (see tblDays, tblMonths, tblYear).
create a Cartesian query agains these tables (qryDays).

second, on VBA create a function that will combine Events
on a particular date (see Module1, fnConcat function).

finally create the final query that will output the days
and the Events associated with that date (FinalQuery).

examine the Criteria of the FinalQuery, and how it calls
fnConcat to produce the results you need.
 

Attachments

Users who are viewing this thread

Back
Top Bottom