Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Suggested answer

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

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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans