Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
SunilChauhan
Champion II
Champion II

SQL error: Must declare the scalar variable "@dpdate".

hello all,

i am getting error while executing the following sql table in qlikview--

error: SQL error: Must declare the scalar variable "@dpdate".

CONNECT

TO [Provider=SQLOLEDB.1;Persist Security Info=False;User ID=psinghInitial Catalog=SCReport;Data Source=10.20.1.46\inco;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=NSL-SEG079L;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is

IWUNWJNMILYKHUFMObKA);



SQL

DECLARE @dpdate datetime;

SQL

DECLARE @ndkey NUMERIC

;



SET

@dpdate = '02/09/2011'

;



SET

@ndkey= report.dbo.Get_DateKey(@dpdate )

;

SELECT





*





FROM



report.dbo.dmension



WHERE @dpdate BETWEEN DateKeyStart AND DateKeyEnd

;





when i am directly using '02/09/2011' in place @dpdate its showing me right result.

please help me .its urgeent.

Sunil Chauhan
0 Replies