Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

stevegimbrollmt
Contributor II

SQL Stored Procedure - How to call current date parameter

Hi Guys

I have a stored proc which I want to run for 2 specific dates... which date is a parameter.

currently im doing something like

Let date = today();

Let prevDate = AddMonths(Today(),-1);

Pendinginv:

LOAD *;SQL EXEC (DWH.dbo.gb_FI_CustomersStarRating $('date'));

for some reason it is not executing it...it just jumps it.

Help will be appriciated

Steve

2 Replies
Not applicable

Re: SQL Stored Procedure - How to call current date parameter

Hello Steve,

I think you will need to remove the ' from round the variable. This is an example of a stored procedure call we use :

letThisYear=Year(today());

load*;

sql exec dbo.usp_gls215_build_report_v2 $(ThisYear)

Good luck

John

stevegimbrollmt
Contributor II

Re: SQL Stored Procedure - How to call current date parameter

Very kind and helpful

Actually here is what I did and it worked!

Let Date = date(today(),'yyyy/MM/dd');

Let prevDate = date(AddMonths(Today(),-1),'yyyy/MM/dd');

Pendinginv:

LOAD *;SQL EXEC DWH.dbo.gb_FI_CustomersStarRating '$(Date)';