I am not sure if my question should be posted here or under queries but I thought I'd give this a shot. I'm new to the forum and by new means an expert with Access but I can follow directions and usually tweak other folks' stuff to get it to work for me. Anyway, I have two tables (Current and Previous) in the db that capture pipeline activity. The tables have the same columns (OrderNum, Amt, Status, Cancel_Date) in each. I am trying to find any OrderNum that has a change in value on any of the columns between the two tables and I want to state which column(s) changed.
I don't need to find OrderNums that are on Current table and not on the Previous table (or vice versa). Only OrderNums that are on both tables but with different values in any column.
As an example of the data on the tables:
Current table has OrderNum 1, Amt 100, Status A, Cancel_Date Null
Current table has OrderNum 2, Amt 100, Status I, Cancel_Date Null
Current table has OrderNum 3, Amt 100, Status A, Cancel_Date Null
Previous table has OrderNum 1, Amt 125, Status A, Cancel_Date Null
Previous table has OrderNum 2, Amt 100, Status I, Cancel_Date Null
Previous table has OrderNum 3, Amt 100, Status I, Cancel_Date Null
I am looking for an end result of:
OrderNum 1 Change in Amt
OrderNum 3 Change in Status
I would not want to return OrderNum 2 because there was no change in any column.
Also, if multiple columns changed on a particular OrderNum then I would like to be able to list out each column that changed (Change in Amt, Cancel Date).
Each of my tables will have about 25,000 rows on it. And, while I only listed out 4 columns there are more like 12 (and more will be added as folks request them).
Is this something that can be done via Code or a Query? Let me know if you have any questions. Thank you for your time!!!
I don't need to find OrderNums that are on Current table and not on the Previous table (or vice versa). Only OrderNums that are on both tables but with different values in any column.
As an example of the data on the tables:
Current table has OrderNum 1, Amt 100, Status A, Cancel_Date Null
Current table has OrderNum 2, Amt 100, Status I, Cancel_Date Null
Current table has OrderNum 3, Amt 100, Status A, Cancel_Date Null
Previous table has OrderNum 1, Amt 125, Status A, Cancel_Date Null
Previous table has OrderNum 2, Amt 100, Status I, Cancel_Date Null
Previous table has OrderNum 3, Amt 100, Status I, Cancel_Date Null
I am looking for an end result of:
OrderNum 1 Change in Amt
OrderNum 3 Change in Status
I would not want to return OrderNum 2 because there was no change in any column.
Also, if multiple columns changed on a particular OrderNum then I would like to be able to list out each column that changed (Change in Amt, Cancel Date).
Each of my tables will have about 25,000 rows on it. And, while I only listed out 4 columns there are more like 12 (and more will be added as folks request them).
Is this something that can be done via Code or a Query? Let me know if you have any questions. Thank you for your time!!!