In the database I have inheritted I have records from two locations that use the same structured backend. The problem I have is I want to combine them. Example Below:
TableSale
SaleID *
Date
Total
Location
TableSaleDetail
DetailID *
SaleID <
ItemID
ItemPrice
Quantity
* = Primary Key
< = Foreign Key
The problem is that I can have a Sale #1 from both locations.
This is an H2O'd down version, but that's how the tables are set up. When condensing the records into a single back end I thought of making a new table with a new Primary key for Sales Records, taking the No Dups option off of the SaleID, removing the PK, and then just linking that to the SaleDetail table. By giving a location criteria in my queries it would eliminate pulling the wrong sale data, but it would pull the wrong detail data.
Flowing this data in is going to be a regular (weekly) event, I'm trying to figure something out. Any help is always appreciated.
TableSale
SaleID *
Date
Total
Location
TableSaleDetail
DetailID *
SaleID <
ItemID
ItemPrice
Quantity
* = Primary Key
< = Foreign Key
The problem is that I can have a Sale #1 from both locations.
This is an H2O'd down version, but that's how the tables are set up. When condensing the records into a single back end I thought of making a new table with a new Primary key for Sales Records, taking the No Dups option off of the SaleID, removing the PK, and then just linking that to the SaleDetail table. By giving a location criteria in my queries it would eliminate pulling the wrong sale data, but it would pull the wrong detail data.
Flowing this data in is going to be a regular (weekly) event, I'm trying to figure something out. Any help is always appreciated.