I’m trying to take append to a table by first setting up a query that is supposed to find unmatched records from table A in the traditional Access way:
INSERT INTO OrdMain
(Group_ID, CO_Number)
SELECT CustHeader.Cust_ID + ‘000000’ AS GroupID, CustHeader.CO_Number
FROM CustHeader LEFT OUTER JOIN
OrdMain ON CustHeader.CO_Number = OrdMain.CO_Number
WHERE (OrdMain.CO_Number IS NULL)
GROUP BY CustHeader.CO_Number
HAVING (CustHeader.CO_Number ‘MICKEY’)[
The CustHeader is the everything-since-the-dawn-of-time data and the OrdMain is the only-what-they-want-to-see data. I’m using this in a project against a SQL database. The old way it worked was that if there was, by any chance, a matching record, it would append the rest and give us either a table of paste errors or just not process the data. Now that we’re using SQL, the stored procedure representing this append just fails.
Iif I’m left joining two tables where the key field on the second table is null, shouldn’t this result in just new records? Is this just an SQL thing? Should I be asking this in another forum?