I’m not sure how to word this, but I want to use the UNION SELECT command to join two tables together and then link another table to this joined query.
I have two invoice tables (InvoiceCompanyA & InvoiceCompanyB) which are identically setup. I then have a InvoiceDetail which lists all the invoiced items from both companies. I would like to create a report that lists all the invoices and details from both companies. The reason for the two tables for CompanyA & CompanyB is that the invoice numbers have to be incremental and unique to each company.
The tables are structured like below:
InvoiceCompanyA
· InvoiceNo
· JobNo
· Company
· Date
· Currency
· Total
InvoiceCompanyB
· InvoiceNo
· JobNo
· Company
· Date
· Currency
· Total
InvoiceDetail
· InvoiceNo
· Item
· StockNo
· Description
· Qty
· UnitPrice
I’d like the report to list the details as below:
InvoiceNo| Company| Date| JobNo| Item| Stock No| Description| Qty| UnitPrice
I have two invoice tables (InvoiceCompanyA & InvoiceCompanyB) which are identically setup. I then have a InvoiceDetail which lists all the invoiced items from both companies. I would like to create a report that lists all the invoices and details from both companies. The reason for the two tables for CompanyA & CompanyB is that the invoice numbers have to be incremental and unique to each company.
The tables are structured like below:
InvoiceCompanyA
· InvoiceNo
· JobNo
· Company
· Date
· Currency
· Total
InvoiceCompanyB
· InvoiceNo
· JobNo
· Company
· Date
· Currency
· Total
InvoiceDetail
· InvoiceNo
· Item
· StockNo
· Description
· Qty
· UnitPrice
I’d like the report to list the details as below:
InvoiceNo| Company| Date| JobNo| Item| Stock No| Description| Qty| UnitPrice