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 :
Small and medium business | Business Central, N...
Answered

Use date month and day format in business central

(0) ShareShare
ReportReport
Posted on by 80
-- procedure GetMonthStartDateAndEndDate(StartYear: Integer; Month: Integer): Date
I have StartYear and Month as an integer . My task is to integrate them and return into date .For example, I have StartYear = 2022 and Month = 1 so, I need to return 
01/01/2022

People have given me approach to use format and evaluate but I am a beginner in this case.  If any one could help me? 

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi Sujan Khadka ,

    Try to use below line:

    DateVariable := DMY2Date(01,Month,StartYear)

    Thanks.

  • Sujan Khadka Profile Picture
    80 on at

    Thank you so much your help. Really appreciated!

  • Sujan Khadka Profile Picture
    80 on at

    For Year, I need 4 characters like 2022 but d2my shows only two characters. Is there any solution to this?

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    Please refer the below link.

    docs.microsoft.com/.../dmy2date-function--date-

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at
    [quote user="Sujan Khadka"]

    For Year, I need 4 characters like 2022 but d2my shows only two characters. Is there any solution to this?

    [/quote]

    Here you can read about a lot of standard formats you can use with Business central

    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-format-property

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 715 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 452 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 371 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans