<?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 Trying to use a timestamp to load new data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trying-to-use-a-timestamp-to-load-new-data/m-p/213874#M67508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am extracting data from an SQL database and I store this in a QVD. I would like to use a field from the sql-database with the name time_stamp to filter new data from the database.&lt;/P&gt;&lt;P&gt;The time_stamp field in the database has this format: '2009-03-31 00:00:00.000'&lt;/P&gt;&lt;P&gt;Using&lt;BR /&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;LOAD * FROM table WHERE time_stamp &amp;gt; '2009-03-31 00:00:00.000';&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;works and if I insert another date it works also&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;to use the last reload timestamp I use&lt;BR /&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;B&gt;&lt;BR /&gt;LET&lt;BR /&gt;&lt;/B&gt;&lt;B&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/B&gt; ThisExecTime = Reloadtime();&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;.&lt;BR /&gt; .&lt;BR /&gt;&lt;/STRONG&gt; LOAD * FROM table WHERE time_stamp &amp;gt; $(LastExecTime);&lt;BR /&gt;&lt;BR /&gt;Let LastExecTime = ThisExecTime;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and i get an error, incorect statement, using #$(LastExecTime) gives the same error.&lt;/P&gt;&lt;P&gt;I am missing something but cant really figure it out.&lt;/P&gt;&lt;P&gt;Could anyone please help me a bit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Oct 2009 18:58:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-10-12T18:58:40Z</dc:date>
    <item>
      <title>Trying to use a timestamp to load new data</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-use-a-timestamp-to-load-new-data/m-p/213874#M67508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am extracting data from an SQL database and I store this in a QVD. I would like to use a field from the sql-database with the name time_stamp to filter new data from the database.&lt;/P&gt;&lt;P&gt;The time_stamp field in the database has this format: '2009-03-31 00:00:00.000'&lt;/P&gt;&lt;P&gt;Using&lt;BR /&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;LOAD * FROM table WHERE time_stamp &amp;gt; '2009-03-31 00:00:00.000';&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;works and if I insert another date it works also&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;to use the last reload timestamp I use&lt;BR /&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;&lt;B&gt;&lt;BR /&gt;LET&lt;BR /&gt;&lt;/B&gt;&lt;B&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/B&gt; ThisExecTime = Reloadtime();&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;.&lt;BR /&gt; .&lt;BR /&gt;&lt;/STRONG&gt; LOAD * FROM table WHERE time_stamp &amp;gt; $(LastExecTime);&lt;BR /&gt;&lt;BR /&gt;Let LastExecTime = ThisExecTime;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and i get an error, incorect statement, using #$(LastExecTime) gives the same error.&lt;/P&gt;&lt;P&gt;I am missing something but cant really figure it out.&lt;/P&gt;&lt;P&gt;Could anyone please help me a bit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 18:58:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-use-a-timestamp-to-load-new-data/m-p/213874#M67508</guid>
      <dc:creator />
      <dc:date>2009-10-12T18:58:40Z</dc:date>
    </item>
    <item>
      <title>Trying to use a timestamp to load new data</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-use-a-timestamp-to-load-new-data/m-p/213875#M67509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think there are two problems...&lt;/P&gt;&lt;P&gt;The statement WHERE time_stamp &amp;gt; $(LastExecTime); needs to have single quotes round the variable, i.e.&lt;/P&gt;&lt;P&gt;... WHERE time_stamp &amp;gt; '$(LastExecTime)';&lt;/P&gt;&lt;P&gt;because you are passing a statement to the database to process as SQL, and SQL needs the date in quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, if LastExecTime does not exist when you first run the script, it will not expand into anything. Try setting a default value before you need to use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 19:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-use-a-timestamp-to-load-new-data/m-p/213875#M67509</guid>
      <dc:creator />
      <dc:date>2009-10-12T19:32:43Z</dc:date>
    </item>
    <item>
      <title>Trying to use a timestamp to load new data</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-use-a-timestamp-to-load-new-data/m-p/213876#M67510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first run I had covered by indeed assigning a default value.&lt;/P&gt;&lt;P&gt;The addition of the ' before and after did it. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 19:43:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-use-a-timestamp-to-load-new-data/m-p/213876#M67510</guid>
      <dc:creator />
      <dc:date>2009-10-12T19:43:22Z</dc:date>
    </item>
    <item>
      <title>Trying to use a timestamp to load new data</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-use-a-timestamp-to-load-new-data/m-p/213877#M67511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another thing you can try is to ensure that the timestamp is ready like a timestamp, eg. by using timestamp#(2009-03-31 00:00:00.000) or the date#()-function. Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2009 14:03:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-use-a-timestamp-to-load-new-data/m-p/213877#M67511</guid>
      <dc:creator />
      <dc:date>2009-10-13T14:03:57Z</dc:date>
    </item>
  </channel>
</rss>

