I've been referred to this site by one of my friends; working with SQL query that's already built in (not really good at it and trying to learn); our Fiscal Year ended on Sept. 30 and new Fiscal Year took place (Oct to Sept). When pulling the report using the saved query; I've found that some of the data are missing as it is pulling the current Fiscal Year's data.
I'm wondering where exactly can I tweak in to pull the data for FY 2019! Here are the queries:
declare #FFY int
set #FFY = dbo.ufn_GetFederalFiscalYear(getdate())
Any help would be great. Thank you :-)
Mansur
declare #FFY int
set #FFY = 2019
Related
I am running a query weekly to get a data set. Each week the data is a bit different. Can I do something to only get the differences from one week to another?
Thank you!
Please suggest me how can I change date range dynamically in BigQuery . For example fiscal year 2017 (4-5-4 calendar) had 371 days verses 364 days in fiscal year 2018. I don't want to change this manually every year.
Any help would be appreciated.
You can solve this by creating the source view separately which cab be then joined with the main code. So that, any changes made in the source code will be reflected in the main code and can be reused in multiple programs.
This way you won't have to change the date range manually all the queries.
for more details, please refer dynamic date range in BigQuery
hoping someone can help. I have an textbox on a report that I need to calculate a new date value for from another date on the report.
I need to take an existing shipping date (say 5/5/2014) and calculate a new date which is one year later but on the Monday of that week (so would be 5/4/2015) -- we only ship product on Mondays.
I know I need to use DateAdd and probably DatePart but have been unable to find the proper formula.
can anyone help?
figured it out -- thanks for all the help. I took the idea that Gordon had, putting it in my select statement rather than trying to manipulate it in the expression area of the textbox on the report:`SELECT DATEADD(wk,DATEDIFF(wk,0,DATEADD(YY,1,o.REQ_DATE)),0) as NewDate'
works great! :)
I need to create a SSRS report where the user specifies the start and end date (e.g. March 2012 to July 2012) and the result is a report with the following headings:
User Department Product Mar-12 Apr-12 May-12 Jun-12 Jul-12
The dates are stored in a datetime column (e.g.2012-06-11 14:48:04.787) in my SQL table which I'm using to build the time-series report.
Do I need to convert/transpose my SQL table first? Or should I be processing this in SSRS?
Your advice is much appreciated!
Based on your question it appears all your dates are in a single datetime column and your trying to display them, formatted as a month, in a single report with the report columns grouped and renamed based on the month. This is a pivot and I don't think you can do that within SSRS. The dataset will already need to be pivoted by the time SSRS gets it.
So, to me this sounds like something you'll have to do both pre and post SSRS. I did a similar report using days of the month. You can see the winning answer here. as opposed to months of the year.
Thinking through your logice, I think you'll probably have to build the query with the pivot and then send to SSRS. On the SSRS side you need 12 columns for all 12 months and then put some logic to hide the ones that don't get data. Your original pivot will need to be smart enough to pass the empty months so SSRS doesn't error out. The end result will appear the same but needs a lot of pre-thought and design effort up front.
You do the processing using SSRS - you would design it in the GUI editor(BIDS ) , and you can customize things using the VBasic code also(i.e, dates and logic)
Looks like you need an intro, I really recommend this video
Wonder if anyone has done this before and what solution you came up with?
I have a Stored Proc that basically is a financial aged debtors query. I have added params to it so that you can select the Start Date, Frequency and Period length of the query. e.g. I could pick 12 months back from TODAY or 01/01/2012 or 4 Quarters back or 1 year back depending on the detail of the output I wish to see.
All well and good and when I run it in SQL it is lovely and works beautifully. I have pivoted the data within the SP in different ways depending on the Period param so that the columns show correctly (i.e. Shows the month name column for months, Quarter name for quarters etc etc.) so the pivot is conditional on the input parameter.
As I say in SQL it is a beautiful thing... now how the hell do I display it in SSRS!? :o)
As the PIVOT is conditional I can't see the available fields and I've got to a point where I can't think anymore of a way around it.
Any help appreciated!
Assuming I got you right, there is an option to place the entire SP in the Dataset.
In the dataset properties , change the query type to Store Procedure.
Hope it helps for you...