I have a query I use across 20 tables to check for differences for them.
Before my updating process begins my original table is copied to a backup table.
In this case the original table is named "vermillion" and it is copied to "vermillion_b4" as a backup.
Generally I then run updates on the original table, and at the end I run a make table query that checks each record in vermillion for a change against vermillion_b4, which ideally creates a table that only contains the differences (ie: the changes that were made that day, whether they be additions or updates).
This works flawless on 19 of the tables, but not on Vermillion for some reason. Out of over 10,000 records the query ALWAYS returns at least 464 of the records as being changed.
I can take the "vermillion" table, copy it directly to "vermillion_b4", make no changes at all and run the query, and I still get the same 464 records. I don't see how an exact duplicate of itself can return any changes on this table, but not any of the others.
here is the query I am using:
SELECT Vermillion.* INTO Verm_Updated
FROM Vermillion LEFT JOIN Vermillion_B4 ON Vermillion.UWI=Vermillion_B4.UWI
WHERE (((Nz(Vermillion.Operator,""))<>Nz(Vermillion_B4.Operator,"")) And ((Vermillion.Flag) Is Null)) Or (((Nz(Vermillion.[X Coord],""))<>Nz(Vermillion_B4.[X Coord],"")) And ((Vermillion.Flag) Is Null)) Or (((Nz(Vermillion.[Y Coord],""))<>Nz(Vermillion_B4.[Y Coord],"")) And ((Vermillion.Flag) Is Null)) Or (((Nz(Vermillion.Status,""))<>Nz(Vermillion_B4.Status,"")) And ((Vermillion.Flag) Is Null))
(note: my original query does not have spaced in the word 'operator' and 'status'. When i have my post open for editing I do not see these spaces either, but for some reason after I post it is adding these arbitrary spaces)
The query continues on a bit longer with some more of the same. I can post the whole thing if necessary, but the format is exactly the same.
I use this exact query for my other tables - I simply copy this code to wordpad, use a text replace to change the table names, and run it directly. I even tried replacing this query with one that works and just changed the table names to match the vermillion tables. Same results.
How can a tables fields be different from an exact duplicate of that table?
Thank you very much to anyone who can help me. this is driving me nuts.
Before my updating process begins my original table is copied to a backup table.
In this case the original table is named "vermillion" and it is copied to "vermillion_b4" as a backup.
Generally I then run updates on the original table, and at the end I run a make table query that checks each record in vermillion for a change against vermillion_b4, which ideally creates a table that only contains the differences (ie: the changes that were made that day, whether they be additions or updates).
This works flawless on 19 of the tables, but not on Vermillion for some reason. Out of over 10,000 records the query ALWAYS returns at least 464 of the records as being changed.
I can take the "vermillion" table, copy it directly to "vermillion_b4", make no changes at all and run the query, and I still get the same 464 records. I don't see how an exact duplicate of itself can return any changes on this table, but not any of the others.
here is the query I am using:
SELECT Vermillion.* INTO Verm_Updated
FROM Vermillion LEFT JOIN Vermillion_B4 ON Vermillion.UWI=Vermillion_B4.UWI
WHERE (((Nz(Vermillion.Operator,""))<>Nz(Vermillion_B4.Operator,"")) And ((Vermillion.Flag) Is Null)) Or (((Nz(Vermillion.[X Coord],""))<>Nz(Vermillion_B4.[X Coord],"")) And ((Vermillion.Flag) Is Null)) Or (((Nz(Vermillion.[Y Coord],""))<>Nz(Vermillion_B4.[Y Coord],"")) And ((Vermillion.Flag) Is Null)) Or (((Nz(Vermillion.Status,""))<>Nz(Vermillion_B4.Status,"")) And ((Vermillion.Flag) Is Null))
(note: my original query does not have spaced in the word 'operator' and 'status'. When i have my post open for editing I do not see these spaces either, but for some reason after I post it is adding these arbitrary spaces)
The query continues on a bit longer with some more of the same. I can post the whole thing if necessary, but the format is exactly the same.
I use this exact query for my other tables - I simply copy this code to wordpad, use a text replace to change the table names, and run it directly. I even tried replacing this query with one that works and just changed the table names to match the vermillion tables. Same results.
How can a tables fields be different from an exact duplicate of that table?
Thank you very much to anyone who can help me. this is driving me nuts.
Last edited: