Unanswered: Insert into one table based on one condition and insert into another based on another
So I started out this query fine. But towards the end where I begin speaking english in the query is because I don't know how to do it. All I know is it needs to be one whole query but based on one condition, it is inserted into one table and based on another condition it's inserted into another table. This is in Microsoft Access.
SELECT contacts.id, contacts.names_1, contacts.names_2, contacts.addresses INTO PrepareForDuplicateCheck
FROM contacts, possibles
WHERE (INSTR(CONTACTS.NAMES_1, possibles.fullname) > 0)
(INSTR(CONTACTS.NAMES_2, possibles.fullname) > 0)
CONTACTS.us_states_and_canada = "FL"
CONTACTS.us_states_and_canada = "NY"
and IIF(possibles.middle_initial IS NOT NULL)
BUT if the first, last, and middle initial cannot be found together in Contacts using the conditionh specified in the INSTR function then
INSERT INTO Extras
(INSTR(CONTACTS.NAMES_2, possibles.first_and_last_name) > 0)