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

Date data type issue

(0) ShareShare
ReportReport
Posted on by 386

Hey everyone,

There is a small requirement that I have created a table along with some fields. I have one date field in it. I want that whenever I select date from this field there should be only year drop down and not having month and days. How can I do that?

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 77,925 Super User 2025 Season 1 on at
    Date data type issue
    Hi, sorry for the late reply, I hope the following information can give you some help.
    Dynamics 365 Business Central: Select the only Year (Month or Day) when entering dates(Only year drop)
     
    Thanks
    ZHU
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,273 Moderator on at
    RE: Date data type issue

    You can try with MinValue, MaxValue, ValuesAllowed property of that field.

  • RE: Date data type issue

    One thing more I want to ask. How can we limit number of digits in an integer datatype field.

  • RE: Date data type issue

    Okay Nitin. Thank you.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,273 Moderator on at
    RE: Date data type issue

    You have to show two fields on the page one field where you will select the Date and in other one it will show the Year of that date. but what you are asking it not possible.

     field(DateField; FORMAT(rec."New Date Field", 0, ''))
                        {
                            ApplicationArea = all;                        
                        }
                        field(DateField2; rec."New Date Field")
                        {
                            ApplicationArea = all;
                        }

  • RE: Date data type issue

    Hey Nitin, thank you for responding but it is not working.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,273 Moderator on at
    RE: Date data type issue

    Hi,

    Can you try this? If it helps you

    field(DateField; FORMAT(rec."New Date Field", 0, ''))
                        {
                            ApplicationArea = all;                        
                        }

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans