3 Replies Latest reply: May 20, 2016 9:56 AM by Tamil Nagaraj RSS


    Treasure Dlamini



      am still new to qlikview, so I would like to know how to I insert SQL variables in qlikview...please see SQL variables I want to insert


      declare @Yesterday varchar (8)

      declare @today varchar (8)

      declare @FirstDayOfCurrMonth varchar (8)

      declare @LastDayOfCurrMonth varchar (8)





      set  @Yesterday =    (select convert(varchar,DATEADD(d, -1, getdate()),112 ))

      set  @today =    (select convert(varchar,getdate(),112 ))

      set  @FirstDayOfCurrMonth =     (select convert(varchar,dateadd(d,-(day(dateadd(m,-0,getdate()-1))),dateadd(m,-0,getdate()-0)),112))

      set  @LastDayOfCurrMonth = (select CONVERT(varchar,dateadd(d,-(day(dateadd(m,1,getdate()))),dateadd(m,1,getdate())),112))



      print @Yesterday

      print @today

      print @FirstDayOfCurrMonth

      print @LastDayOfCurrMonth