1 Reply Latest reply: Jun 20, 2013 3:49 PM by Ilia Barantchouk RSS

    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!!!