Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Pass Dynamic Parameters from QlikView Tables or List Box back to the SQL Query in Script Window ?

Hi,

I was working on the below queries

As the first query loads the Dates into QlikView from where user should be able to select the dates on which the SP need to execute and give the result set.

SQL Select Date as StartDate, Date as EndDate from Dim_Date where Calendar_Year in ('2013','2014');

SQL EXEC ('[dbo].[usp_rpt_MonthlyRevenue_bySource] "$(vStartDate)", "$(vEndDate)"  ' )

Can any one let me know the process to pass those values using variables.

Thanks in Advance.

3 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

Try like this

SQL EXEC [dbo].[usp_rpt_MonthlyRevenue_bySource] '$(vStartDate)', '$(vEndDate)';


Let me know if that worked.


Regards

ASHFAQ

Not applicable
Author

Hi Ashfaq,

Thanks for responding, below is the error i got

ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: Error converting data type varchar to date.

SQL EXEC [dbo].[usp_rpt_MonthlyRevenue_bySource] 'StartDate', 'EndDate'

Thanks in Advance

ashfaq_haseeb
Champion III
Champion III

HI,

Make sure your variable '$(vStartDate)', '$(vEndDate)'

Holds proper date formats.

Regards

ASHFAQ