Auto Generate report or records from table

Chopper83150

New member
Local time
Today, 06:36
Joined
Nov 5, 2013
Messages
9
HI,
I am hoping for some help please.

I have a table called bookings, three records within that table are;

arrivaldate
departuredate
breakfast

This Table (Bookings) is linked to the guest table via GUESTID

Assuming that a guest arrive on the 5th and leaves on the 10th, I am trying to create a breakfast voucher for the guest for each day of their stay.

So 5 vouchers, 1 each for the 6th, 7th, 8th, 9th, and 10th
I have created the breakfast voucher as a report and a query to include data but I dont know how to propagate the new data to actually create the vouchers. All I can get is data for the arrival or departure fields.

I have had a look at other threads but cant find what I want.. I apologize if this has already been covered

This is my first database and any help would be greatly appreciated

Kindest Regards
 
Last edited:
well the "easy" solution is to make a table with only 1 column, which contains values 1,2,3,4,5,6,7,..., 29,30 (assuming a 30 stay is going to be long enough ...
Lets call it tblDays, the column DayNumber

Then "Cartesian" your report with this table. Aircode:
Code:
Select ... StartDate + DayNumber (From above new table)
From Yourtable
, tblDays
where startdate + DayNumber <= EndDate

Alternatively you can "activate" the report the required amount of times in VBA passing the required dates to the report thru the use of "OpenArgs" to populate the report's date with.
 
That worked a treat... Thanks,
 
Last edited:

Users who are viewing this thread

Back
Top Bottom