How to show previously selected Parameter by default - sql

I have an SSRS report in which I've a Data Parameter. I want something like: Suppose I select a Date 10JAN2014, then when I return again to the same report I want the date parameter already set to 10JAN2014. Is it possible in SSRS ?

There is few options...
You need to create a table , use update statement which will put currently selected value ,then in
parameter properties use that column as default value.
You can also try to extract that value from execution log from report server.

Related

Populate variable using SQL output

I currently use the following to dynamically alter the date range in my queries:
'${MY_DATE}'::timestamp
Is there a way to dynamically populate this rather than have the user input the value in a pop-up? I'd like to be able to run the query and it would automatically select the maximum date that exists in the table, add one day to that value and use that in the dynamic parameter throughout the queries in my script.
I've tried, something like this but it still generates the pop-up:
insert into '${MY_DATE}'::timestamp select max(SOME_DATE_FIELD) from MY_TABLE;
Thank you!

SAP HANA SQL - Relative Date in Query

We are trying to build better dynamic reporting in our SQL queries from SAP HANA. Currently we either have to hard code the values, or we have a python tool which we update the values, but we are looking to point Tableau Server direct to SAP HANA and not have to go in and update the date ranges we are looking at.
We are looking to get a dynamic date selection for current and prior year where the structure is YYYYMMM in both the FROM and TO functions.
FROM "_SYS_BIC"."fvr.Revenue.FVRRsummary/ST_FVRR_COPA" (
'PLACEHOLDER' = ('$$IP_FROM_FISCAL_YR_PER$$', '2019001'),
'PLACEHOLDER' = ('$$IP_TO_FISCAL_YR_PER$$', '2020012')
There's no need to use external tool to update parameter's values, because HANA Calculation View has ability to calculate parameter's dafault value (e.g. when no external value passed to it from SQL/MDX).
You can use simple calculations to set default value for parameter in parameter definition screen. They can be based on constants, some other parameter's value or meta-information (like current date, logon language).
For your case you can use a parameter type Direct and set default values as follow:
IP_FROM_FISCAL_YR_PER: format(addmonths(now(), -12), 'yyyy"001"').
IP_TO_FISCAL_YR_PER: format(now(), 'yyyy"012"').

Default user parameters in PyCharm

I love that I can parameterize SQL queries in Pycharm. I an write a statement like so
select * from table where date >= ?
and will then be prompted for the value to be filled in for the ?.
Alas, I will be prompted afresh every time. Is there a way of specifying a set of default parameters? Bonus points for being able to pull these parameter values from a JSON/yaml file.

Passing multiple parameter values to crystal reports using SQL

I have in my report a few needed arguments like 'A','B','C' and I would like to pass it using SQL.
How can I do that?
I tried prm_szDiscType='C','N','P' , prm_szDiscType = C,N,P, and prm_szDiscType=''C'',''N'',''P''
I'm not sure how you pass parameters via URL.
In Crystal Reports desktop client, I created a Command Parameter with "Allow multiple values" check on.
Then in my Command SQL, I use a where clause such as:
where item in {?Item}
When you check "Allows multiple values" on, Crystal will create the clause after in. If you select Value Type of String, the values you enter will automatically be wrapped in single quotes.
Credit to ExpertsExchange thread on command parameters ;)

Crystal Report Parameter - how to stop parameter appearing twice

I currently have a report which feeds off a stored procedure with the parameters being two date fields i.e. dateto and datefrom.
Now within crystal report and not sql I have created another parameter which asks for the option to select the company the employee belongs to, this can be multiple option or not.
My issue now is that when I run the report the first parameter prompt I get is only the stored procedure parameters, once I input these values another parameter window appears asking for the stored procedure parameters again i.e. the dates but this time also the company parameter.
Is it possible to only have one parameter window prompt with the dates and company parameter appearing once and having to be entered once ?
You can check two aspects:
There is no subreport in this report.
Option "Verify on First Refresh" and "Verify Stored Procedures on First Refresh" are unchecked.