I keep getting duplicate records in my query result. I tried using Unique Records and also Unique Values and that did not work either.
Here is the SQL for it. I have used 2 queries combined to try and get my result. InvoiceFirstPart shows me Customers Order Details.
InvoiceSecondPart shows me the Products Ordered and Payments made.
[SELECT DISTINCT InvoiceFirstPart.OrderID, InvoiceFirstPart.CustomerID, InvoiceFirstPart.EmployeeID, InvoiceFirstPart.OrderDate, InvoiceFirstPart.PurchaseOrderNumber, InvoiceFirstPart.ShipDate, InvoiceFirstPart.ShippingMethodID, InvoiceFirstPart.Comment, InvoiceSecondPart.ProductID, InvoiceSecondPart.Quantity, InvoiceSecondPart.UnitPrice, InvoiceSecondPart.Discount, InvoiceSecondPart.[Extended Price], InvoiceSecondPart.Payment, InvoiceSecondPart.PaymentMethod, InvoiceSecondPart.CheckNo, InvoiceSecondPart.DatePaid, InvoiceFirstPart.CustBillingAddress, InvoiceFirstPart.CustCity, InvoiceFirstPart.CustStateOrProvince, InvoiceFirstPart.CustZIPCode, InvoiceFirstPart.CustShipAddress, InvoiceFirstPart.CustShipCity, InvoiceFirstPart.CustShipStateOrProvince, InvoiceFirstPart.CustShipZIPCode, InvoiceFirstPart.CustContact, InvoiceFirstPart.CustShipVia, InvoiceFirstPart.CustTerms
FROM InvoiceFirstPart RIGHT JOIN InvoiceSecondPart ON InvoiceFirstPart.OrderID = InvoiceSecondPart.PayID
ORDER BY InvoiceFirstPart.OrderDate;]
Thanks for taking a look.