[AccessD] A2K: Need a Smarter Append Query

Darren DICK d.dick at uws.edu.au
Mon May 12 21:23:58 CDT 2003


Hello all
I have an append query that gets a few columns from one table(Bookings) and puts those
few columns into another table (tblWarnings) Based on today's date. Very basic, see SQL below.

What I really want is for the SQL to only get bookings from the table Bookings and put them into
tblWarnings if they are not already in tblBookings. 

So if tblWarnings already has bookings 1, 2 and 3 from table bookings.
I don't want the SQL to get them again if I run it. But if I add record 4 to table Bookings then 
run the append SQL, I do want it to get record 4 and ignore the other 3. Make sense?

INSERT INTO tblWarnings ( BookingID, BookingDate, BookingTime, Cancelled )
SELECT Bookings.BookingID, Bookings.BookingDate, Bookings.BookingTime, Bookings.Cancelled
FROM Bookings
WHERE (((Bookings.BookingDate)=Date()));

Many thanks in advance

Darren


More information about the AccessD mailing list