G
Guest
I'm pulling records for providers based on terminations and reinstatements
for the past week. It's possible the provider was termed and reinstated
during the week, in which case I don't want them. My current thought process
is to create separate tables for terms and reinstatements, then have a delete
query remove matching records from both tables. However, this is giving me
the "Could not delete from specified tables" error. All three joins are
necessary to ensure matching records. Is it possible to delete records from
both tables this way? If not, can someone suggest a way to ensure both
records are removed.
DELETE [0 Weekly Provider Terms].*, [0 Weekly Provider Reinstates].*
FROM [0 Weekly Provider Reinstates] INNER JOIN [0 Weekly Provider Terms] ON
([0 Weekly Provider Reinstates].doc_suffix = [0 Weekly Provider
Terms].doc_suffix) AND ([0 Weekly Provider Reinstates].tax_id = [0 Weekly
Provider Terms].tax_id) AND ([0 Weekly Provider Reinstates].doc_id = [0
Weekly Provider Terms].doc_id);
for the past week. It's possible the provider was termed and reinstated
during the week, in which case I don't want them. My current thought process
is to create separate tables for terms and reinstatements, then have a delete
query remove matching records from both tables. However, this is giving me
the "Could not delete from specified tables" error. All three joins are
necessary to ensure matching records. Is it possible to delete records from
both tables this way? If not, can someone suggest a way to ensure both
records are removed.
DELETE [0 Weekly Provider Terms].*, [0 Weekly Provider Reinstates].*
FROM [0 Weekly Provider Reinstates] INNER JOIN [0 Weekly Provider Terms] ON
([0 Weekly Provider Reinstates].doc_suffix = [0 Weekly Provider
Terms].doc_suffix) AND ([0 Weekly Provider Reinstates].tax_id = [0 Weekly
Provider Terms].tax_id) AND ([0 Weekly Provider Reinstates].doc_id = [0
Weekly Provider Terms].doc_id);