G
Guest
I have 2 linked tables that have the same kind of data. Table 1 is the live
data and Table 2 is archived data. Both have the same field_names. I want to
build a query that selects all appropriate data from each table.
As an example, both tables contain customer_number, invoice_number,
invoice_amount. There may be customer records in tbl1 that are not in tbl2
and vice versa. I want to create a query that will list all of the records in
each table and combine the data where the customer_number is the same.
tbl1 contains:
Cust1 Inv1 Amt
Cust2 Inv1 Amt
Cust3 Inv1 Amt
Cust3 Inv2 Amt
tbl2 contains:
Cust1 Inv2 Amt
Cust2 Inv2 Amt
Cust2 Inv3 Amt
Cust4 Inv1 Amt
The resulting query should display:
Cust1 Inv1 Amt
Cust1 Inv2 Amt
Cust2 Inv1 Amt
Cust2 Inv2 Amt
Cust3 Inv1 Amt
Cust3 Inv2 Amt
Cust4 Inv1 Amt
I know could build a table that combines all of the data from both sources
and then run the query on the new table, but I'm hoping to avoid that step if
it is unnecesarry. I'm new to access and I'm sure I'm missing the obvious,
but if someone could point me in the right direction, I would appreciate it.
Ted
data and Table 2 is archived data. Both have the same field_names. I want to
build a query that selects all appropriate data from each table.
As an example, both tables contain customer_number, invoice_number,
invoice_amount. There may be customer records in tbl1 that are not in tbl2
and vice versa. I want to create a query that will list all of the records in
each table and combine the data where the customer_number is the same.
tbl1 contains:
Cust1 Inv1 Amt
Cust2 Inv1 Amt
Cust3 Inv1 Amt
Cust3 Inv2 Amt
tbl2 contains:
Cust1 Inv2 Amt
Cust2 Inv2 Amt
Cust2 Inv3 Amt
Cust4 Inv1 Amt
The resulting query should display:
Cust1 Inv1 Amt
Cust1 Inv2 Amt
Cust2 Inv1 Amt
Cust2 Inv2 Amt
Cust3 Inv1 Amt
Cust3 Inv2 Amt
Cust4 Inv1 Amt
I know could build a table that combines all of the data from both sources
and then run the query on the new table, but I'm hoping to avoid that step if
it is unnecesarry. I'm new to access and I'm sure I'm missing the obvious,
but if someone could point me in the right direction, I would appreciate it.
Ted