Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Show days, months and year in one field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I would like to know that is it possible to show the calculated Day, Month, Year  in one field on the form.

I mean that is the difference between two dates is in days then it should show no. of days. 

If the difference between two dates is in months the it should show no. of months and so on.

I have no idea how can I bring a best solution for this. Please let me know if there is solution.

Thank you.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Show days, months and year in one field

    Hi Leah,

    Thank you so much for the response.

    I am trying to do replicate exactly as you explained. But, my requirement is I need to see all Year,Month,Day in one field.

    Can I concat the fields to show in one field.

    for example :   I have one day it shows only 1day

                      If its 1month and 2days it should also show that.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Show days, months and year in one field

    Hi Sravz,

    You can achieve it through calculated fields and business rule.

    Steps:

    1.Create custom fields and add them to the form:

    (1)Three calculate fields to store difference in years/months/days.

    pastedimage1645511739246v5.png

    pastedimage1645510905188v3.png

    pastedimage1645511910504v6.png

    (2) Uncheck 'Visible by default' option for these three fields in the form.

    pastedimage1645513096572v8.png

    2.Create a business rule to populate 'Result' field automatically.

    pastedimage1645513017621v7.png

    IF

    Years greater than 0

    THEN
    Show field Years
    Hide field Months
    Show field Days
    ELSE IF

    Months greater than 0

    THEN
    Show field Months
    Hide field Years
    Hide field Days
    ELSE
    Show field Days
    Hide field Years
    Hide field Months

    3.Test Result:

    pastedimage1645513371260v9.png

    Change date and save current record:

    pastedimage1645513395306v10.png

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: Show days, months and year in one field

    Hello,

    If you want to have something like that I would recommend creating a PCF control for that purpose.

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,468 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,287 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans