First of all, I did search this forum for all threads with "combine" in the title, but couldn't find exactly what I'm talking about here. If it has been discussed before, please bear with me.
The situation is as follows.
The scenario:
I work at a freight brokerage company. We currently collect and manage three different types of rates in three spreadsheets. I have prepared and normalized all of the data and created a table in our DB for each collection of rates.
Before I list the tables and relationships, let me preface it by saying that there are business reasons for these tables being laid out the way they are, so making too drastic of changes to them isn't very feasible.
The tables:
As indicated, I have three tables (primary key is *, foreign keys all have ID in name)
tblCustLanes
*LaneID
CustomerID
VendorID
ConsigneeID
Miles
CustomerRate
FSC
TCU
Loop
XStop
Notes
DateEntered
tblRouting
*RoutingID
LaneID (tblCustLanes)
FleetID
Priority
FleetRate
FSC
EmployeeID
ContactID
Notes
DateEntered
tblMRD
*MrdID
CustomerID
FleetID
OriginCity
OriginST
DestCity
DestST
FleetRate
EmployeeID
ContactID
Notes
DateEntered
Relationship: 1 tblCustlanes record to n tblRouting records
tblRouting contains rates from our carriers for business that we actually do. tblCustLanes has the information pertaining to the customer, and we can have many carriers for one lane, thus many tblRouting records for one tblCustLanes record.
The MRD contains "fishing" rates, i.e. rates that carriers have provided us on potential lanes, but we do not have any information other than city-city. Since the lane is not "real" and contains no other information, we do not want to include it in tblCustLanes for multiple reasons.
This situation would be fine in and of itself. However we wish to see rates from both tblRouting and tblMRD combined into one list. This was possible when everything was in Excel, because I just had a macro that would copy/paste the info from both spreadsheets into one, and leave blanks where there was no information. Obviously a query doesn't work that way, so I'm at a loss as to how to mimic this functionality in Access. Here is what I want the end result to be:
CustomerName
FleetName
OriginCity
OriginST
DestCity
DestST
FleetRate
EmployeeName
ContactName
Notes
Date
The kicker is that the cities and states would come from the city/st fields in tblMRD, but come from separate Vendor and Consignee tables for tblCustLanes.
I don't know much about union queries, but don't think I can accomplish this with one, since the tables really don't have anything in common, and both are using related tables. Can anybody help me with this? I really need to find a way to create results similar to the way it is currently done in Excel, otherwise I have no argument for bringing it into the DB.
Thank you for reading this exhausting post!