Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Unanswered

i want to use sql query in x++ i am unable to write

(0) ShareShare
ReportReport
Posted on by 5

Hello,

i have a simple query of sql but i am unable to write the query in x++ please see the below 

my sql query 

select * from MZNUNInventOnhandItemPricesHistory a
inner join INVENTDIM d on d.INVENTDIMID = a.INVENTDIMID
where a.FROMDATE = (select max(b.FROMDATE) from MZNUNInventOnhandItemPricesHistory b)

i have written the below query but unable to wirte query for where clause

public void populateinventtrans()

{
MZNUNInventOnhandItemPricesHistory inventOnhandItemPricesHistory;
delete_from _mak_priceTagtbl;
insert_recordset _mak_priceTagtbl(itemid,itemname,msp,smp,purchaseprice,wholesalesprice,gfprice,retailpricesrp,companyfix,fromdate,todate,comments,fixcommission)
select itemid,itemname,msp,smp,purchaseprice,wholesalesprice,gfprice,retailpricesrp,companyfix,fromdate,todate,comments,fixcommission from inventOnhandItemPricesHistory
;
}

Please help me in this. how i can write this query in x++ while i have tried many of times.

Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,876 Super User

#2
Ludwig Reinhard Profile Picture

Ludwig Reinhard Microsoft Employee

#3
Martin Dráb Profile Picture

Martin Dráb 225,425 Super User

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans