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,

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
Martin Dráb Profile Picture

Martin Dráb 225,425 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans