<?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 QlikView vs SQL Server Date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/QlikView-vs-SQL-Server-Date/m-p/164605#M37245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;Thanks for the quick response, knowing that QlikView's date starting point is different to SQL Server means I can adjust the date by adding 2.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Isabel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Oct 2010 12:42:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-10-29T12:42:15Z</dc:date>
    <item>
      <title>QlikView vs SQL Server Date</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-vs-SQL-Server-Date/m-p/164603#M37243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;I am in the process of writing a generic script for incrementally loading and updating qvd files based on a date field and I have come accross some unusual behaviour in the way QlikView and SQL Server convert numeric dates.&lt;/P&gt;&lt;P dir="ltr"&gt;MaxLoad:&lt;/P&gt;&lt;P dir="ltr"&gt;LOAD max(ModifyDate) as MaxF&lt;/P&gt;&lt;P dir="ltr"&gt;FROM $(vLoadFile) (qvd);&lt;/P&gt;&lt;P dir="ltr"&gt;Let vMAX = peek('MaxF', 0, 'MaxLoad');&lt;/P&gt;&lt;P dir="ltr"&gt;'$(vDTQVD)':&lt;/P&gt;&lt;P dir="ltr"&gt;Load&lt;/P&gt;&lt;P dir="ltr"&gt;*;&lt;/P&gt;&lt;P dir="ltr"&gt;SQL SELECT *&lt;/P&gt;&lt;P dir="ltr"&gt;FROM $(vTable) WHERE $(ModifyDate) &amp;gt; $(vMAX);;&lt;/P&gt;&lt;P dir="ltr"&gt;'$(vDTQVD)':&lt;/P&gt;&lt;P dir="ltr"&gt;LOAD * FROM $(vfLoadFile)(qvd)&lt;/P&gt;&lt;P dir="ltr"&gt;WHERE NOT EXISTS ( [$(vIDField)] );&lt;/P&gt;&lt;P dir="ltr"&gt;When I started to run this code against a changing data set, noticed that I was dropping records and on debugging found the following behaviour:-&lt;/P&gt;&lt;P dir="ltr"&gt;vMAX = 40408.194&lt;/P&gt;&lt;P dir="ltr"&gt;SQL Server interprets this as&lt;/P&gt;&lt;P dir="ltr"&gt;SELECT CAST(40408.194 AS DATETIME) FROM vTable returns 2010-08-20 04:39:21.600&lt;/P&gt;&lt;P dir="ltr"&gt;but QlikView returns 2010-08-18 04:39:21.600&lt;/P&gt;&lt;P dir="ltr"&gt;Any feedback would be fantastic as the numeric method feels so much cleaner than formating the dates as text.&lt;/P&gt;&lt;P dir="ltr"&gt;Isabel&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Oct 2010 12:17:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-vs-SQL-Server-Date/m-p/164603#M37243</guid>
      <dc:creator />
      <dc:date>2010-10-29T12:17:20Z</dc:date>
    </item>
    <item>
      <title>QlikView vs SQL Server Date</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-vs-SQL-Server-Date/m-p/164604#M37244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Isabel,&lt;/P&gt;&lt;P&gt;Indeed, QliKView internally uses date format counting since 31/12/1899 (1) and so on. Since some timestamp include time and date, there you have those decimals in the QlikView date. This will likely help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LOAD Ceil(max(ModifyDate)) as MaxFFROM $(vLoadFile) (qvd);&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Anyway, a precedent load script would help, so the dates are stored as integers in your QVD files:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Load Date(DateField, 'DD/MM/YYYY') AS DateField;SQL SELECT *FROM $(vTable) WHERE $(ModifyDate) &amp;gt; $(vMAX);&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;When you store it now, all values will be properly formatted. You can duplicate fields should you want to keep dates and times in one field but use the other to storeing and loading purposes.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Oct 2010 12:26:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-vs-SQL-Server-Date/m-p/164604#M37244</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-10-29T12:26:04Z</dc:date>
    </item>
    <item>
      <title>QlikView vs SQL Server Date</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-vs-SQL-Server-Date/m-p/164605#M37245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;Thanks for the quick response, knowing that QlikView's date starting point is different to SQL Server means I can adjust the date by adding 2.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Isabel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Oct 2010 12:42:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-vs-SQL-Server-Date/m-p/164605#M37245</guid>
      <dc:creator />
      <dc:date>2010-10-29T12:42:15Z</dc:date>
    </item>
  </channel>
</rss>

