Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Error while calculating date 02/29/20 using DMY2Date on a leap year

(0) ShareShare
ReportReport
Posted on by 1,645

Hello folks,

We have some transactions made on 02/29/20. Today (03/02/20), end user is getting below error when running February transactions.

"The value of DMY2Date parameter 1 is outside of the permitted range. The current value is 29. The permitted range is :from 1 to 28.

How or where can I chance the number of dates for February?

Thank you.

  • spyroot Profile Picture
    spyroot 1,645 on at
    RE: Error while calculating date 02/29/20 using DMY2Date on a leap year

    Thank you

  • Suggested answer
    THE Italian Profile Picture
    THE Italian on at
    RE: Error while calculating date 02/29/20 using DMY2Date on a leap year

    This is indeed strange. Just tested the example provided with

    https://docs.microsoft.com/en-us/dynamics-nav/dmy2date-function--date-

    pastedimage1583325777542v1.png

    This is working like a charm. 

    I think that you should check with debugger the code where this is coming from and test out with the simple prototype

    ...

    Day := 29;
    month := 2;
    year := 2020;
    outputdate := DMY2DATE(Day, month, year);
    MESSAGE(Text1000, Day, month, year, outputdate);

    ...

    If this does not work either then the best bet are:

    1. Outdated platform number for your NAV 2017 version. Test using the latest platform file.

    2. Year that you pass by is not 2020 but something else

    3. Worth checking if you pass 2020 or 1920 or whatever else. Debugger never lies.

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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans