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.
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.
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..
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
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,564 Super User 2024 Season 2
Martin Dráb 228,651 Most Valuable Professional
nmaenpaa 101,148