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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Only year in a date field

(0) ShareShare
ReportReport
Posted on by 365

I have a form where people can enter a date or pick from the calendar. dd/mm/yyyy. However, there will be times where we do not know the day or month so people will only want to enter the year. This field will not allow this. The solution seems to be to create another field for year only. This seems messy as I will need to be aware that this data could be in either field and any reports I do will need to check both date fields.

Is there a better way of doing this? I could get rid of date field all together and have 2 separate fields for date, month year but that then makes calculations difficult.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Only year in a date field

    If you don't want to create a new field for year. You can create a two option field stating whether to use the full date or just the year part of the entered date value.

  • Suggested answer
    nghieppham Profile Picture
    4,755 on at
    RE: Only year in a date field

    Hi jsteelecrm,

    You should change to use the Mask Format in Datetime field. You can implement it via JQuery. Please check this link for some sample.

    stackoverflow.com/.../specify-date-format-in-mask-when-using-an-input-mask

    archive.conductiva.com/.../Improvement-in-the-Masked-Input-Plugin-for-jQuery

    Regards,

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Only year in a date field

    You can create a number field for year and copy it over to the date field as 1/1/[year] OnChange via javascript. Still a bit messy front-end but you'll have all the dates in one place.

  • Suggested answer
    ShahXu Profile Picture
    1,515 on at
    RE: Only year in a date field

    Hello,

    create two fields

    1) datetime

    2) Text Field

    if you know the month date and year then fill date time else ask user to just input the year in text field

    on save you check if date time has any value then get that value and set in the text field and if it doesn't have any then there should be a value text field

    so you can use that text field in your reports.

    if both fields are null then prevent to save the form and show alert and ask them fill anyone of them

  • Jenn_STEP Profile Picture
    126 on at
    RE: Only year in a date field

    i have added this as an idea, as it would be really useful. You can vote for this here: experience.dynamics.com/.../

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans