Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

how to Convert DATE Datatype into TEXT DataType ?

(1) ShareShare
ReportReport
Posted on by 7
I have date  01/04/2020 in Date datatype. Now, I want to convert and return to TEXT datatype. Is there any solution?
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 75,595 Super User 2024 Season 2 on at
    how to Convert DATE Datatype into TEXT DataType ?
    Hi, if this is related to language encoding, you can try the FormatDate method in the codeunit below. This returns a Text date.
     
    Hope this helps.
    Thanks.
    ZHU
  • Ariba Mehdi Profile Picture
    Ariba Mehdi 160 on at
    how to Convert DATE Datatype into TEXT DataType ?
    Hi,

    Try the following 2 possible solutions: 
     
    1. Check System.Format() method from the link shared below:
     
    2. Try using StrSubsNo(). Check the link below the image as well. 
     
    Hope this helps!
  • Verified answer
    Judy Profile Picture
    Judy Microsoft Employee on at
    how to Convert DATE Datatype into TEXT DataType ?
    Hi,
     
    To convert a date in the Date datatype to Text datatype in AL, you can use the FORMAT function.
    Txt:= Format(Dt);
    The reference Document:
     
    Best Regards,
    Judy

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans