G
Guest
I have 3 tables Table_A, Table_B, Table_C. Each month I need to compare
tables A & B and copy the differences to table C and update 2 fields on table
C, one with current date, and a second field with a status either NEW or
REMOVED.
Each month Table_B gets cleared, I copy the records from Table_A to Table_B
and Table _A gets cleared and loaded with new data. The first query will
compare Table_A to Table_B (left join based on a key field) and any records
on Table_A that are not on Table_B are considered NEW. A copy of this record
will be written to Table_C and I need to update two fields on Table_C along
with this record, a date field (will have current date when record was added)
and a status field that will have the value "NEW" placed in it. The second
query will compare Table_B to Table_A (left join based on a key field) and
any records on Table_B that are not on Table_A are considered REMOVED. A copy
of this record will be written to Table_C and I need to update two fields on
Table_C along with this record, a date field (will have current date when
record was added) and a status field that will have the value "REMOVED"
This is like doing an Append query and an Update query in one. Is there a
simple way to do this, or do I first need to Append the records in to Table_C
then run an Update query to update the date and status of the records that
have null values in the Date and Status fields?
Thanks in advance for your help.
Kenny A.
tables A & B and copy the differences to table C and update 2 fields on table
C, one with current date, and a second field with a status either NEW or
REMOVED.
Each month Table_B gets cleared, I copy the records from Table_A to Table_B
and Table _A gets cleared and loaded with new data. The first query will
compare Table_A to Table_B (left join based on a key field) and any records
on Table_A that are not on Table_B are considered NEW. A copy of this record
will be written to Table_C and I need to update two fields on Table_C along
with this record, a date field (will have current date when record was added)
and a status field that will have the value "NEW" placed in it. The second
query will compare Table_B to Table_A (left join based on a key field) and
any records on Table_B that are not on Table_A are considered REMOVED. A copy
of this record will be written to Table_C and I need to update two fields on
Table_C along with this record, a date field (will have current date when
record was added) and a status field that will have the value "REMOVED"
This is like doing an Append query and an Update query in one. Is there a
simple way to do this, or do I first need to Append the records in to Table_C
then run an Update query to update the date and status of the records that
have null values in the Date and Status fields?
Thanks in advance for your help.
Kenny A.