Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 181 Super User 2025 Season 1

#2
Siv Sagar Profile Picture

Siv Sagar 149 Super User 2025 Season 1

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 124 Super User 2025 Season 1

Product updates

Dynamics 365 release plans