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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

DDMMYYYY date format in x++

(0) ShareShare
ReportReport
Posted on by 1,215

Hi all,

I want to in the report date should be : 01/02/2021

I can achieve in report design property <Date<Custom<dd/MM/yyyy>

i don't wanna add to design level u may ask why don't u want because report designer has in xml format.

today only I want to achieve in x beoz its argent.

below my code.

Tmp.TransDate = any2Date(date2Str(_header.TransDate, 123,4,2,4,2,2));

As i mentioned code not working what am i missing ?

Thanks

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Riyas,

    The command any2date() is converting a string to a date value. The date value is not aware of the format to be used on a report. In fact you tried to pick a date, convert it to text with a certain format and then directly convert back to a date. It is some additional roundtrip to get the same as "tmp.TransDate = _header.TransDate"

    Can you elaborate on the 'xml format' comment? What is the exact issue here?

  • Suggested answer
    Sumit Loya Profile Picture
    2,230 on at

    Hi Riyas ahamed F,

    I would suggest then you create a string field instead of Date field. If you have date field, and don't specify format on the report text box, it will take format from the user locale info.

    If you dont want to  specify date format in designer then create a String field in Report table and format the date using date2Str(_header.TransDate, 123,4,2,4,2,2). Then use that string field to display on report.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 499 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans