Avatar of Zack
Zack
Flag for Australia asked on

X++ Convert to SQL

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
Microsoft DynamicsSQL

Avatar of undefined
Last Comment
Zack

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Damon Repton

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Zack

ASKER
Cheers Damon i'll begin researching. 
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck