web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to add no of days to a date using x++

(0) ShareShare
ReportReport
Posted on by 4

i have two dates (vendtrans.TransDate == vendSettlement.TransDate) now i want to ensure if  vendSettlement.TransDate date is within 180 days from vendtrans.TransDate  how to do it

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,843 Moderator on at

    Hi SachinMittal,

    You need to subtract and vendSettlement.TransDate - To get the date difference.

    int nosOfDays;
    
    nosOfDays = vendtrans.TransDate - vendSettlement.TransDate;
    if(nosOfDays > 180)
    {
        //do something
    }

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,573 Moderator on at

    Hi Sachin, As Girish mentioned, you can subtract the dates to get the difference and no conversion is required.

    Check this thread

    community.dynamics.com/.../how-to-calculate-the-number-of-days-in-two-date-and-apply-the-updaterecordset

  • GirishS Profile Picture
    27,843 Moderator on at

    Sorry I am not clear with your question.

    I think you need to check whether vendTrans.TransDate is within 180 days from vendSettlement.TransDate.

    So you can directly add dates like below.

    vendTrans.TransDate + 180;

    It will add 180 days to date value.

    Thanks,

    Girish S.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 622

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 532 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 430

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans