Delete Queries using Unmatched Query

G

Guest

Reading many helpful responses on this site, but unfortunately none of them
seem to remedy my current issue.

Just learning Access, took a quick college prep course, got the basics. Now
I am expanding freelance. SO the scenarios is my test idea that I have
intent to apply on larger scale. I have a database with 15 records... lets
say reservations (tbl_reservations) for a hotel. Used a maketable to copy
that table because it gets updated often to cancelled or complete status. So
I filter out the 9 of those 15 reservations which are still in pending status
and make the new table (tbl_pending_reservation) from those. The next day I
append 4 more pending reservations from the reservations table and add then
to pending res table. but now 4 of the original 9 reservations are
cancelled. I perform an unmatched query to find the 4 listed as pending in
the pending reservation and listed as cancelled in the reservations table.

What is the best method of deleting the 4 records that are incorrect on the
pending reservation table. (keep in mind this is 4 records, but in the end
it may be 1000's of records.)

I appreciate anyone taking the time to respond as this may be a wonderful
example for others.
 
G

Guest

In additional to the given scenario, also please assist me with inverse of
scenario. Let us assume after appending the pending reservations table to 9
entries, and the append query was run again. For whatever reason, all 9
entries have been added a second time. Running a Find Duplicates Query
reveals all 9 records twice each.

How would I delete from the pending reservations, 1 of each entry?
 
G

Guest

Not sure why you need a "Pending Reservations" table; is this as opposed to
"Confirmed Reservations"? It is not usually a good idea to store the same
information in multiple tables for just this reason. When you update one,
you have to update the other.

I think I'd just have a Reservations table. Any reservation that starts on
a future date, and does not have a confirmation number is a pending
reservation. Then, when you cancel the reservation, you only have to do it
in one place.

If you are stuck with this structure, I would set it up so that as soon as a
reservation is cancelled, it is deleted from the Pending Reservations table.

HTH
Dale
 
G

Guest

I will take your suggestion and apply it in the manner you suggest, but in
practice, is there a way that a match query or unmatch query can be used in a
delete query?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top