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, ...
Answered

Calculated date field in report writer

(0) ShareShare
ReportReport
Posted on by 15

Hello, 

I need to add  calculated field in report write that displays a Date Range. 

The base field is PA Period End Date and I need to calculate a new date which is 6 days prior. Then, combine these 2 fields to get the date range to print on the report. 

Something like this if we do in SQL, (DateAdd("d", -6, PAPeriodEndDate)) + "-" + (PAPeriodEndDate). 

How can we do this in report writer? Any suggestions? Much appreciated. 

Thanks, 

Vidya 

Categories:
I have the same question (0)
  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,095 Most Valuable Professional on at

    Hi Vidya

    You should just be able to add subtract an integer from a date in a calculated field to go back a number of days.

    I added some functions to the Report Writer as system user defined functions.

    RW_AddMonth() Add or substract a month

    RW_MakeDate() Create a date from Month, Day, Year values

    RW_SetDate() Adjust a date using Month, Day. Year values 

    RW_DateToString() Convert a date to a string in any format

    RW_DiffDate() Get the number of days between two dates

    RW_SysDate() Get the system date

    Details for these functions are in the RW_Func.doc document in the SDK (see \Tools\SDK folder on the Dynamics GP DVD image)

    Regards

    David

  • VidyaG Profile Picture
    15 on at

    David,

    Thanks for the response.

    Would you mind providing more details on this? Which function I can use to subtract an integer from a date in a calculated field?

    I cant find a function that can serve the purpose from SDK documentation. I may be missing something here. Please help.

    Thanks,

    Vidya

  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,095 Most Valuable Professional on at

    I don't think a function is required. Just subtract an integer value from a date.

    Regards

    David

  • VidyaG Profile Picture
    15 on at

    Thank you.

    I never thought it is as simple as that :). I am able to accomplish what I need.

    -Vidya

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 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans