Skip to main content

Notifications

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:
  • VidyaG Profile Picture
    15 on at
    RE: Calculated date field in report writer

    Thank you.

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

    -Vidya

  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,036 Most Valuable Professional on at
    RE: Calculated date field in report writer

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

    Regards

    David

  • VidyaG Profile Picture
    15 on at
    RE: Calculated date field in report writer

    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,036 Most Valuable Professional on at
    RE: Calculated date field in report writer

    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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans