Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Calculate Days Between Dates with Dexterity

Posted on by Microsoft Employee

I'm working on a custom window in Dexterity, and I need to calculate the number of days between two dates.  Is there a way to do this with Dexterity?  I originally thought about using the day() function, but quickly realized that would only work if the two dates were in the same month.  Any help or ideas would be greatly appreciated.

Thanks,

Bill

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calculate Days Between Dates with Dexterity

    This worked perfectly thank you.  I never even tried that.  I just assumed it was going to return a date not just number of days.

  • Verified answer
    Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: Calculate Days Between Dates with Dexterity

    Dexterity allows you to do a simple straight up subtraction between two date fields, which returns a long integer value representing the number of days between the two, i.e.,

    local long date_diff;
    
    date_diff = '(L) Start Date' - '(L) End Date';

    You can call the RW_DiffDate() Report Writer user-defined function that already takes care of this:

    local long date_diff;
    
    date_diff = RW_DiffDate('(L) Start Date', '(L) End Date');

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans