Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Concatenating two date fields

Posted on by 430

Anybody know how I can concatenate two date fields in report writer?  I tried creating a calculated field but it errors out. 

I need to concatenate the Contract start and end date on an invoice. 

Thanks,

Tina

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Concatenating two date fields

    Where can I find the FUNCTION_SCRIPT? 

    It is not in the system defined or user defined function options.

    Thank you

    M

  • Verified answer
    Tina Haerr Profile Picture
    Tina Haerr 430 on at
    RE: Concatenating two date fields

    Justin,

    THANK YOU, THANK YOU, THANK YOU!

    I was able to get the two dates to concatenate and it looks GREAT!  It's exactly what I needed.  Thank you so much for responding!

  • Suggested answer
    Justin Thorp Profile Picture
    Justin Thorp 2,265 on at
    RE: Concatenating two date fields

    Hi Tina,

    Kirk's advice is great if you are creating a report based on a SQL query.

    If you are using GP's "Report Writer" then I suggest you create a calculated field like the following (I'm Concatenating the same date field to itself):

    STRIP(FUNCTION_SCRIPT(RW_DateToStringPM_Paid_Transaction_HIST.Document Date"DD-MM-YYYY" )  )  # STRIP(FUNCTION_SCRIPT(RW_DateToStringPM_Paid_Transaction_HIST.Document Date"DDMMYYYY" )  )

    Note:  The "RW_DateToString" function can be found on the functions tab, with the "User-Defined" radio button selected, in the "System" core.

    Note:  The "STRIP" function can be found on the functions tab, with the "System-Defined" radio button selected.

    Note:  I've used 2 different formats in the RW_DateToString for illustration ("DD-MM-YYYY" and "DDMMYYYY")

    Note:  You can find more information about the User-Defined functions here:  blogs.msdn.microsoft.com/.../using-the-built-in-report-writer-functions

    Thanks,
    Justin

  • Suggested answer
    KirkLivermont Profile Picture
    KirkLivermont 5,985 on at
    RE: Concatenating two date fields

    Tina,

    Use the cast function to convert the date fields into strings and then concatenate the two. I believe date fields are generally stored as date time so you may also want to strip some characters.

    Regards,

    Kirk

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans