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

How to Create an SSRS Parameter that will let me choose only the months of the current year?

(0) ShareShare
ReportReport
Posted on by 70

Hi all,

I just want to create a parameter that will allow me to choose only the months of the current year to filter my report

I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    What exactly do you mean by "months of the current year"? Without more details requirements, we can say that the current year - as another other year - has twelve months. If you want just one month, use an enum with month names. If you need something else, please explain your actual requirements.

    By the way, which version of AX is it about?

  • AklG Profile Picture
    70 on at

    Okay, the parameter is for a payslip report so by selecting let's say May from the parameter, it will give me the info of May/2022 (current year) and not all May of the payslip

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    I'm not sure what you mean by "giving the info of May". If you mean that you want to apply a query range for May of the current year, let the user select a month and then create query ranges for the current year in code.

    Note that according to your requirements, users won't be able to select December of the last year when running the report in January. I'm not sure that it's a good desing.

    Can you please answer the question about the version of AX? I wouldn't asked if you selected a specific version when creating the thread.

  • AklG Profile Picture
    70 on at

    am using D365fo version 10.0.11 (10.0.464.10002)

    okay so you mean I only need to create an enum ( Jan-Dec)

    and put this enum in the Contract class and then

    what should I do specifically in the DP class?

  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    I moved the thread from Dynamics AX forum to Dynamics 365 Finance forum and set the category to Development / Customization / SDK.

    Don't create the enum - I'm pretty sure that it already exists.

    What code you should write in the DP class depends on what you want it to do. You need to deside it first. For example, let's say that you have a single field called TransDate and you want to filter by this field. If so, a possible approach is using TransDate >= [first day of the month && TransDate <= [last day of the month.

    You can calculate the dates by something like this:

    date fromDate = mkDate(1, month, year(systemDateGet());
    date toDate = endMth(fromDate);

    How you should apply the range depends on the way how you select the data - either by a while select statement or Query* classes.

    It'll be much easier to give you an answer if you tell us more about what you want.

  • AklG Profile Picture
    70 on at

    goshoom  thank you!

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

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans