<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Comparing Date column with variable in where clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1189693#M384557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using the to_timestamp() function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Select Col1, Col2, Col3, LoadTime&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;from TableA where LoadTime &amp;gt; to_timestamp('$(V_LoadTime)', 'MM/DD/YYYY HH:MI:SS AM');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Sep 2016 20:19:39 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-09-26T20:19:39Z</dc:date>
    <item>
      <title>Comparing Date column with variable in where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1189690#M384554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I am using QlikSense v3.0, I created 2 sections one is Initial load and other is Delta Load. &lt;/P&gt;&lt;P&gt;2) In Initial load I am storing my "LoadTime" column into qvd file called "MaxLoadTime.qvd".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) I am using MaxLoadTime.qvd and storing that value into variable "V_LoadTime" in my Delta load SQL statement, which looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) In Intial load the format I stored is &lt;/P&gt;&lt;P&gt;MaxLoadTime:&lt;/P&gt;&lt;P&gt;LOAD TIMESTAMP(TIME(MAX("LoadTime"),'MM/DD/YYYY HH:MM:SS.FF AM')) AS MaxLoadTime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE MaxLoadTime INTO [lib://QDATA/MaxLoadTime.qvd];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) In Delta load I am calling it as&lt;/P&gt;&lt;P&gt;UpdateLoadTime:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;MaxLoadTime FROM [lib://QDATA/MaxLoadTime.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET V_LoadTime = peek('MaxLoadTime,0,UpdateLoadTime);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE UpdateLoadTime;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIB CONNECT TO 'DATABASE'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Col1,&lt;/P&gt;&lt;P&gt;Col2,&lt;/P&gt;&lt;P&gt;Col3,&lt;/P&gt;&lt;P&gt;LoadTime;&lt;/P&gt;&lt;P&gt;Select &lt;/P&gt;&lt;P&gt;Col1,&lt;/P&gt;&lt;P&gt;Col2,&lt;/P&gt;&lt;P&gt;Col3,&lt;/P&gt;&lt;P&gt;LoadTime&lt;/P&gt;&lt;P&gt;from TableA&lt;/P&gt;&lt;P&gt;where LoadTime &amp;gt; $(V_LoadTime)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to load the data I am getting error saying&lt;/P&gt;&lt;P&gt;ErrorSource: OraOLEDB, ErrorMsg: ORA-00936: missing expression: SQL &lt;/P&gt;&lt;P&gt;SELECT Col1,Col2,Col3,LoadTime from TableA &lt;/P&gt;&lt;P&gt;WHERE LoadTime &amp;gt; 9/21/2016 3:31:12 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 13:03:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1189690#M384554</guid>
      <dc:creator>sasqliksense</dc:creator>
      <dc:date>2016-09-21T13:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Date column with variable in where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1189691#M384555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try enclosing the variable expansion into single quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;where LoadTime &amp;gt; '$(V_LoadTime)'&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Besides this, double check the format code section in the HELP, I think your format should look like&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TIMESTAMP( MAX("LoadTime"),&lt;STRONG&gt;'&lt;/STRONG&gt;MM/DD/YYYY&lt;STRONG&gt; hh:mm:ss.ff TT')&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2865"&gt;On Format Codes for Numbers and Dates&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 19:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1189691#M384555</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-21T19:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Date column with variable in where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1189692#M384556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I applied the format you given in your reply, the date format in my variable is like "9/25/2016 09:35:09 AM", which is my MAX(LoadTime).&lt;/P&gt;&lt;P&gt;But when I update the LoadTime column in my table and try to run the Delta load it is not picking up the updated record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Query is&lt;/P&gt;&lt;P&gt;Select Col1, Col2, Col3, LoadTime&lt;/P&gt;&lt;P&gt;from TableA where 'LoadTime' &amp;gt; '$(V_LoadTime)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The column LoadTime&amp;nbsp; datatype is Timestamp(6) in my oracle table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Sep 2016 06:40:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1189692#M384556</guid>
      <dc:creator>sasqliksense</dc:creator>
      <dc:date>2016-09-25T06:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Date column with variable in where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1189693#M384557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using the to_timestamp() function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Select Col1, Col2, Col3, LoadTime&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;from TableA where LoadTime &amp;gt; to_timestamp('$(V_LoadTime)', 'MM/DD/YYYY HH:MI:SS AM');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 20:19:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1189693#M384557</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-26T20:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Date column with variable in where clause</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1508459#M436470</link>
      <description>&lt;P&gt;this looks like old post but me to&amp;nbsp; facing same issue. any solution were you able to find.&lt;/P&gt;&lt;P&gt;In incremental load where clause&amp;nbsp; date columns is to be compared with variable of max date as mentioned.&lt;/P&gt;&lt;P&gt;Date_aof_aft &amp;gt; '$(V_&lt;SPAN&gt;Date_aof_aft&lt;/SPAN&gt;_qvd)'&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;Date_aof_aft= Date column&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Nov 2018 07:27:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-Date-column-with-variable-in-where-clause/m-p/1508459#M436470</guid>
      <dc:creator>amar_nath_etta</dc:creator>
      <dc:date>2018-11-17T07:27:11Z</dc:date>
    </item>
  </channel>
</rss>

