Skip to main content

Notifications

Announcements

No record found.

How to get latest record based on the date and time in D365. #x++ #d365 #dynamics

My requirement was pretty simple, I needed to get the latest record based on the date and time. So I wrote this query to get the required record. 
 
 
 select firstonly SettleAmountCur from vendSettlement
                order by CreatedDateTime desc
                where vendSettlement.OffsetTransVoucher == vendTrans.Voucher
                    && vendSettlement.TransCompany == vendTrans.DataAreaId
                    && vendSettlement.AccountNum == vendTrans.AccountNum;

Comments

*This post is locked for comments