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 :
Microsoft Dynamics GP (Archived)

How to write a query to compare Current year fiscal period sales to Last year Fiscal Period sales in SQL Server

(0) ShareShare
ReportReport
Posted on by

I am trying to write a query in SQL server that pulls data from multiple tables and stores it into a new table and I only want the data that compares current year Fiscal period to Last year Fiscal period. 

Any help is greatly appreciated. 

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    P.S : I already have a table that has fiscal period and year defined so I can just join that table. To be specific, I want to write a query that only gives data for last year fiscal period based on current year fiscal period.

  • Richard Wheeler Profile Picture
    75,848 Moderator on at

    You can follow these examples plus use the SQL DateDiff function to separate current and last fiscal years.

    stackoverflow.com/.../how-to-do-a-sum-inside-a-case-statement-in-sql-server

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    Hi NP41,

    Maybe it would be much simpler to just use Management Reporter 2012 to do that work ? it has built-in functions to pull data based on Fiscal periods, so you could compare current period with LY period at the same time, and even add the Budget for that period..

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 > 🔒一 Microsoft Dynamics GP (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
mtabor Profile Picture

mtabor 1

#2
Victoria Yudin Profile Picture

Victoria Yudin 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans