Append when values don't match?

G

Guest

I was looking at a way to do this with code, but it was a bit over my head,
and it just occurred to me that I might be able to do it with an append
query.

The DB is set up to track casino customer counts by machine vendor, by floor
(broken up into zones with tables), by shift (broken into hourly counts using
shift table). The vendors - zone relationship is m2m, linked with a junction
table.

The actual customer counts are in a table linked to zones, times, and
vendors, with the PK being the GamingDay, ZoneID, CountTime, and VendorID

I would like the user to select a date, floor, and shift, using a form, and
have the database look at the counts table to see if there is data there for
the corresponding values. If they are not there, I would like to add those
values to the counts table, with the default count value of zero.

I was going to do it with code, but it occurs to me that an append query
might work. I have a query (call it queryA) that looks at the peripheral
tables to see the different possible values that should be in the counts
table, (without the gamingday). And I have a similar query (call it
queryB)that checks the counts table for entries corresponding to the selected
date, floor, and shift.

Is it possible to write an append query that compares these two queries, and
adds the entries from queryA (that aren't present in queryB) to the count
table?

Aaron
 
G

Guest

Never mind - I ran an unmatched values wizard, fiddled until I got it right,
then made it an append 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