Hi EE,
I have the following X++ query:
While Select SalesId, SalesName, PurchOrderFormNum from salesTable
join InvoiceAccount, InvoiceDate, invoiceId, SalesId, CurrencyCode, SalesBalance from custInvoiceJour
where salesTable.SalesId == custInvoiceJour.SalesId
&& custInvoiceJour.InvoiceAccount == custVendPaym.ledgerJournalTrans().AccountNum
Exists Join custTrans
where custTrans.Invoice == custInvoiceJour.InvoiceId
&& custTrans.AccountNum == custInvoiceJour.InvoiceAccount
&& custTrans.TransDate == custInvoiceJour.InvoiceDate
Exists join custTransOpen
where custTransOpen.AccountNum == custTrans.AccountNum
&& custTransOpen.RefRecId == custTrans.RecId
Exists join specTrans
where specTrans.RefCompany == custTransOpen.dataAreaId
&& specTrans.RefTableId == custTransOpen.TableId
&& specTrans.RefRecId == custTransOpen.RecId
Exists join ledgerJournalTrans
where specTrans.SpecCompany == ledgerJournalTrans.dataAreaId
&& specTrans.SpecRecId == ledgerJournalTrans.RecId
&& specTrans.SpecTableId == LedgerJournalTrans.TableId
&& ledgerJournalTrans.AccountNum == custVendPaym.ledgerJournalTrans().AccountNum
Open in new window
How would I convert this to SQL? Any assistance is appreciated.
Thank you