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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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,647

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.

I have the same question (0)
  • Suggested answer
    THE Italian Profile Picture
    on at

    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.

  • spyroot Profile Picture
    1,647 on at

    Thank you

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans