Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
stevegimbrollmt
Creator II
Creator 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

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
Creator II
Creator II
Author

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)';