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

Fiscal Dates in SSRS Report - Starting to Ending Date

(0) ShareShare
ReportReport
Posted on by 2

Hello All,

I am trying to help my IT group with getting a SSRS report to work properly. We are trying to get the functionality in the smartlist where the transaction date is between Beginning of Period and End Period to work in a SSRS report. 

Using this code, stole from SQL queries for fiscal years and periods in Dynamics GP by VICTORIA YUDIN. I tried to see if this could be starting point, but our IT group hasn't had any luck.

SELECT    D.PERIODID Period_Number,    D.PERNAME Period_Name,    D.PERIODDT Starting_Date,    D.PERDENDT Ending_Date,    D.YEAR1 Fiscal_Year FROM SY40100 D INNER JOIN    SY40101 H    ON H.YEAR1 = D.YEAR1 WHERE    D.FORIGIN = 1 AND D.PERIODID <> 0    and GETDATE() between H.FSTFSCDY and H.LSTFSCDY ORDER BY D.PERIODID

This is the result.

Period_Number Starting_Date Ending_Date Fiscal_Year
Period 1 2020-04-01 2020-05-03 2021
Period 2 2020-05-04 2020-05-31 2021
Period 3 2020-06-01 2020-06-28 2021
Period 4 2020-06-29 2020-08-02 2021
Period 5 2020-08-03 2020-08-30 2021
Period 6 2020-08-31 2020-09-27 2021
Period 7 2020-09-28 2020-11-01 2021
Period 8 2020-11-02 2020-11-29 2021
Period 9 2020-11-30 2020-12-27 2021
Period 10 2020-12-28 2021-01-31 2021
Period 11 2021-02-01 2021-28-28 2021
Period 12 2021-03-01 2021-03-31 2021


What I want to do is to get the start and ending date to be pulled into the parameter of the SSRS based on the server date. For example today is 2020-07-07. The Starting date would be 2020-06-29 and the ending date would be 2020-08-02.

I am a complete novice on SQL and my Google Fu hasn't found anything that has pointed me in the right direction.

Any help would be much appreciated and Thanks in advance.

Categories:
I have the same question (0)
  • Becky Berginski Profile Picture
    on at

    Thank you for using Community Forums. My name is Becky and I will assist you.

    Can you tell me if your are trying to create a custom SSRS report or if you are trying to modify a canned SSRS report?

    If it is a customer report,  you would want to post this in the SSRS reports forums, or open a case with the SSRS Microsoft Team,

    as they would be the best resource for assisting with formatting of reports being built from the ground up.

    If this is one of our reports, we need to know which report it is, and we could give adding the parameter a try.

    Becky

  • bgajjar Profile Picture
    150 on at

    Hi There, 

    In your query just change highlighted part in where condition, this will return one row as per current date

    SELECT D.SERIES, D.PERIODID Period_Number, D.PERNAME Period_Name, D.PERIODDT Starting_Date, D.PERDENDT Ending_Date, D.YEAR1 Fiscal_Year
    FROM SY40100 D INNER JOIN SY40101 H ON H.YEAR1 = D.YEAR1
    WHERE D.FORIGIN = 1 AND D.PERIODID <> 0 and GETDATE() between D.PERIODDT and D.PERDENDT
    ORDER BY D.PERIODID

    I guess this is what you are looking. if not, if you can explain in detail. i may help you.

    Thanks

    Bharat

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