Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

change the date format with the Sales Transaction Entry invoice

Posted on by 100

the default setup we have is all numbers.  Is 02/03/18 February 3rd or March 2nd?  How can the date format be changed to 2 Mar 2018?  or Mar 2, 2018?

Dynamics GP2013 SP2

*This post is locked for comments

  • Suggested answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: change the date format with the Sales Transaction Entry invoice

    Hi,

    David Musgrave developed a user-defined function used in version 7 forward that can allow you to display a date in any format you want. Here is a copy of his article:

    From David Musgrave

    Over the years, I have seen a huge amount of effort and multiple calculated fields to format a date field on a report into a desired format that is something other than the default short date format, usually DD/MM/YYYY or MM/DD/YYYY depending on country (as defined in the control panel).

    While you have to admire the efforts that people will go to to get a date displayed in a desired format, it frustrates me that so much effort goes into something that could be so quickly and easily achieved with the RW_DateToString() user defined Report Writer (RW) function.

    The RW_DateToString() function is one of a suite of functions that I developed back in 2002 and got added to the core Dynamics.dic application dictionary for versions 7.0 onwards. For details on the other RW functions added, see the post on this blog in the more information section below.

    To use the RW_DateToString() function, follow the steps below:

    • Create a string calculated field
    • Select User-Defiined Function: RW_DateToString
    • Select the Fields tab
    • Locate the date field you want displayed
    • Click Add
    • Select the Constants tab
    • Select Type: String
    • Enter the Constant as the desired date format template (see below)
    • Click Add
    • Click OK

    The final Calculated Expression should be something like:

    FUNCTION_SCRIPT( RW_DateToString Date "mmmm DD, YYYY" )

    For example:

    For today's date the format string "mmmm DD, YYYY" will produce "August 16, 2010".

    The date format template string is a string constant which describes to the RW_DateToString() function how to display the date. Any text can be contained in the string and the following placeholder characters will be substituted with the appropriate:

    Placeholder Characters Date Component Format

    • ddd day of week as 3 letters
    • dddd day of week in full
    • N day of year
    • NN day of year (padded)
    • D day of month
    • DD day of month (padded)
    • M month of year
    • MM month of year (padded)
    • mmm month of year as 3 letters
    • mmmm month of year in full
    • YY year of date (2 digits)
    • YYYY year of date (4 digits)

    Note: If you want to change the language of the days of the week or the months of the year, please use the Modifier to change Message Resources IDs 12201 onwards and 18618 onwards respectively. These messages are used elsewhere in the application, so changing them here will affect more than just the RW_DateToString() function.

    For more information see the posts below:

    • This blog: Using the built-in Report Writer Functions

    • DynamicsGP.ie blog: International date formats in Report Writer

    I hope this saves you lots of time. Enjoy.

    David

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: change the date format with the Sales Transaction Entry invoice

    The KISS principle strikes again! We wish all our problems were that simple to resolve.

  • GP for JP Profile Picture
    GP for JP 100 on at
    RE: change the date format with the Sales Transaction Entry invoice

    well that was simple - thanks!

  • Verified answer
    Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: change the date format with the Sales Transaction Entry invoice

    That change is made in Windows not GP. This will affect all other applications.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans