3 Replies Latest reply: Feb 2, 2012 1:07 PM by alphez77 RSS

    need to get char(39) in a variable

      Hello community,

       

      I just recently began looking at qlikview and from what I have seen I like it alot

       

      I already manged to imort my tables from a sybase DB and am currently working on a incremental update script. My problem is in the "where clause".

       

      LET vIncrementalExpression = 'StartTime >= ' & date(peek('maxdate'),'YYYY-MM-DD hh:mm:ss') & ' AND ResultReliablityFlag = 1';

      this expression will give me StartTime >= 2012-02-02 16:00:00 AND ResultReliablityFlag = 1 but what I need is:
      StartTime >= '2012-02-02 16:00:00' AND ResultReliablityFlag = 1

       

      I made the ' to emphasize them. I have tried the following variations but nothing worked,

       

      LET vIncrementalExpression = 'StartTime >= ' & 'char(39)' & date(peek('maxdate'),'YYYY-MM-DD hh:mm:ss') & 'char(39)' &  ' AND ResultReliablityFlag = 1';

       

      LET vIncrementalExpression = 'StartTime >= ' & char(39) & date(peek('maxdate'),'YYYY-MM-DD hh:mm:ss') & char(39)  & ' AND ResultReliablityFlag = 1'; <--gives an erro because of char(39)

       

      LET vIncrementalExpression = 'StartTime >= ' & "'" & date(peek('maxdate'),'YYYY-MM-DD hh:mm:ss')  & "'" & 'AND ResultReliablityFlag = 1';

       

      Any ideas how can wrap ' around my dateTime ?

       

      Thanks.