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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

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

Overall leaderboard

Product updates

Dynamics 365 release plans