Append table to table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to append to the tbl_Hotel table all the records from the
tbl_Flight table. The catch is that I would like to append tbl_Hotel for
each night between two dates in tbl_Flight. So someone arriving 1 Oct and
departing 7 Oct woiuld have appended to tbl_Hotel one record for 1 Oct, one
for 2 Oct, one for 3 Oct, etc.

How do I approach this? I would like to add a command button to a current
form that does this.
 
Hi,



Make a SELECT statement that produces the desired set of records, then
append it.


To make that SELECT statement, have a table, IOTAS, one field, iota,
with values from 0 to 99.

SELECT a.*, a.Arriving + b.Iota
FROM myFlights As a INNER JOIN Iotas as b
ON b.iota <= a.Leaving-a.Arriving



should produce the desired result.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top