AX / D365FO – Electronic Reporting Format a Date

In Electronic Reporting you can easily format a Date or DateTime using DATEFORMAT() or DATETIMEFORMAT()

Here is an example of how to use it

DATEFORMAT needs 2 input parameters :

  • Date (or dateTime in case of DATETIMEFORMAT)
  • format (which is the output conversion format)

Code below shows how to convert current date in yyyyMMdd format

DATEFORMAT(TODAY(), "yyyyMMdd"))

Code below shows how to convert current dateTime in yyyyMMdd_hhmmss format

DATETIMEFORMAT(NOW(), "yyyyMMdd_hhmmss")

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s