Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

how to Convert DATE Datatype into TEXT DataType ?

Posted on by 22
I have date  01/04/2020 in Date datatype. Now, I want to convert and return to TEXT datatype. Is there any solution?
Categories:
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 68,480 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 156 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans