Good afternoon,
Could someone please help me with this join.
What I have so far
SELECT INArchivedInvoiceItems_0.desc_, INArchivedInvoiceItems_0.desc2, INArchivedInvoiceItems_0.invtype, INArchivedInvoiceHeaders_0.invno, INArchivedInvoiceItems_0.deldate, INArchivedInvoiceItems_0.delno, INArchivedInvoiceItems_0.stcode, INArchivedInvoiceItems_0.depot, INArchivedInvoiceItems_0.pgroup, STStockDetails_0.sref1, INArchivedInvoiceItems_0.lineval, INArchivedInvoiceItems_0.linecost, INArchivedInvoiceHeaders_0.cref
FROM RPWLIVE.INArchivedInvoiceHeaders INArchivedInvoiceHeaders_0, RPWLIVE.INArchivedInvoiceItems INArchivedInvoiceItems_0, RPWLIVE.SLCustomers SLCustomers_0, RPWLIVE.STStockDetails STStockDetails_0
My tables are (to shorten the names down some):
InvoiceHeaders
InvoiceItems
Customers
StockDetails
Everything is fine if I have the Invoice headers, invoice items and customers - this is because every record in invoice item has a corresponding invoice header and vice versa and every customer ref in an invoice header and invoice item will have customer details with in the customers table.
Where it goes to pot is when I add in the stock details table, this is because our sales office can add in a manual sales line onto an invoice and this manual line does not have a corresponding record in the stock details table, but I need these to appear on my report.
Any help would be greatly appreciated.
Bookmarks