murali2611
Technical User
I have created a REPORT that matches a Purchase Order with an invoice.
The subreport gives totals for each supplier for purchase orders and for invoices.
A purchase order can be matched with more than 1 invoice.
I get the problem when there are more than 1 invoice to be matched to the purchase order.
The purchase order will appear twice in the report if there are 2 invoices for a purchase order.
SELECT DISTINCT PurchaseOrders.PONumber, PurchaseOrders.SPCode, PurchaseOrders.Date, PurchaseOrders.Net, SuppInvoices.SuppID, SuppInvoices.[Inv No], SuppInvoices.Date, Sum(SuppInvoices.Net) AS [Sum Of SuppInvoices_Net]
FROM Quotations INNER JOIN (PurchaseOrders LEFT JOIN SuppInvoices ON PurchaseOrders.PONumber = SuppInvoices.POnumber) ON Quotations.ProjectID = PurchaseOrders.PRCode
WHERE (((PurchaseOrders.PRCode)=[Forms].[ProjectReports].[projcode].[Value]))
GROUP BY PurchaseOrders.PONumber, PurchaseOrders.SPCode, PurchaseOrders.Date, PurchaseOrders.Net, SuppInvoices.SuppID, SuppInvoices.[Inv No], SuppInvoices.Date, Quotations.SalesNet, SuppInvoices.POnumber;
The subreport gives totals for each supplier for purchase orders and for invoices.
A purchase order can be matched with more than 1 invoice.
I get the problem when there are more than 1 invoice to be matched to the purchase order.
The purchase order will appear twice in the report if there are 2 invoices for a purchase order.
SELECT DISTINCT PurchaseOrders.PONumber, PurchaseOrders.SPCode, PurchaseOrders.Date, PurchaseOrders.Net, SuppInvoices.SuppID, SuppInvoices.[Inv No], SuppInvoices.Date, Sum(SuppInvoices.Net) AS [Sum Of SuppInvoices_Net]
FROM Quotations INNER JOIN (PurchaseOrders LEFT JOIN SuppInvoices ON PurchaseOrders.PONumber = SuppInvoices.POnumber) ON Quotations.ProjectID = PurchaseOrders.PRCode
WHERE (((PurchaseOrders.PRCode)=[Forms].[ProjectReports].[projcode].[Value]))
GROUP BY PurchaseOrders.PONumber, PurchaseOrders.SPCode, PurchaseOrders.Date, PurchaseOrders.Net, SuppInvoices.SuppID, SuppInvoices.[Inv No], SuppInvoices.Date, Quotations.SalesNet, SuppInvoices.POnumber;