Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How to set date store procedure argument as nvarchar

Hi there,

I have an SQL store procedure that has a following input parameters:

SET surveyID=111111;

SQL EXEC [dbo].[reportSP_ExportDataFile] @__surveyID = $(surveyID),@__userID = 1,@__langID = 1,

@__startDate= N'2013/05/01',@__endDate=N'2013/06/01';

I would really want to have it dinamic, but cannot set it up like

@__startDate=$(StartDate),@__endDate=$(EndDate);

using the following settings:

SET DateFormat='YYYY/MM/DD';

LET StartDate=Monthstart(today(),-1);

LET EndDate=Monthstart(today());

because I cannot get $(StartDate) and $(EndDate) in the same (nvarchar) format.

Could you please help?

Thank you very much in advance!!!

1 Reply
Not applicable

Re: How to set date store procedure argument as nvarchar

I found the solution myself:

LET StartDate=chr(39) & text(Monthstart(today(),-1)) & chr(39);

LET EndDate=chr(39) & text(Monthstart(today())) & chr(39);

Community Browser