I have following code:
Code |
---|
SEL ECT PaymentLineItems.Payment AS Payment, PurchaseInvoice.Date AS DatePurchase, PurchaseInvoice.Ref AS RefPurchase, PurchaseInvoice.DocumentTotalRC AS PurchaseAmount, PaymentLineItems.Ref.Date AS PaymentDate, PaymentLineItems.Ref AS RefLines, PurchaseInvoice.Company, PurchaseInvoice.Memo, CashDiscountSupplierLineItems.Ref AS CDRef, CashDiscountSupplierLineItems.CashDiscountAmount AS CDAmount FR OM Document.Payment.LineItems AS PaymentLineItems FULL JOIN Document.PurchaseInvoice AS PurchaseInvoice {FULL JOIN Document.CashDiscountSupplier.LineItems AS CashDiscountSupplierLineItems ON (CashDiscountSupplierLineItems.Document = PurchaseInvoice.Ref)} ON PaymentLineItems.Document = PurchaseInvoice.Ref |
and I need to get Joined fileds in one row. The idea is following: there are three types of documents - PurchaseInvoice, Payment and CashDiscount. References to PurchaseInvoice in Payment and CashDiscount are the same.
It seems to work, but I get one row double. Please download the base:
<deleted, please attach files to messages>
Report name is GoodsInBook2.
Thanks for your help