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

Formatting date from a code field

(0) ShareShare
ReportReport
Posted on by

Is it possible to get a formatted date from a date written in a Code field? So '31122020' but written in Code field not Date field.

I managed to successfully do that on a page. I used FORMAT("Arrival Date",0,'<Closing><Day,2>-<Month,2>-<Year>') on a Date field in the SourceExpr attribute. But when I try the same formula with the same data on a Code field it doesn't work.

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Use the evaluate function below is the example, where StDate is of type Date

    DateCode := '01012020';
    EVALUATE(StDate,DateCode+'D');

  • Suggested answer
    raelhefn Profile Picture
    on at
  • Community Member Profile Picture
    on at

    Thank you for your advice. I should have mentioned that I don't have full developer license. I can't add a C/AL variable. I was looking for a one-liner that would work when applied on the field's SourceExpr attribute.

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,577

#2
YUN ZHU Profile Picture

YUN ZHU 888 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 778 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans