<?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 Strange date result SQL script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Strange-date-result-SQL-script/m-p/1522265#M600370</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a very strange issue! We are loading some data using a simple sql script from a view:&lt;/P&gt;&lt;P&gt;ie. select * from AView&lt;/P&gt;&lt;P&gt;There is a field in the view called 'datefeesreceived' that is 0 in the database for certain rows, but when it is viewed in the qvw is shows a date (and&amp;nbsp; I don't mean 30/12/1899 or similar but 24/6/2016!).&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add a 'where' clause to the sql statement so that it only returns the rows that I expect to have 0 value then they come back with 0!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot understand what is going on...&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 04:56:17 GMT</pubDate>
    <dc:creator>juleshartley</dc:creator>
    <dc:date>2024-11-16T04:56:17Z</dc:date>
    <item>
      <title>Strange date result SQL script</title>
      <link>https://community.qlik.com/t5/QlikView/Strange-date-result-SQL-script/m-p/1522265#M600370</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a very strange issue! We are loading some data using a simple sql script from a view:&lt;/P&gt;&lt;P&gt;ie. select * from AView&lt;/P&gt;&lt;P&gt;There is a field in the view called 'datefeesreceived' that is 0 in the database for certain rows, but when it is viewed in the qvw is shows a date (and&amp;nbsp; I don't mean 30/12/1899 or similar but 24/6/2016!).&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add a 'where' clause to the sql statement so that it only returns the rows that I expect to have 0 value then they come back with 0!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot understand what is going on...&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:56:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Strange-date-result-SQL-script/m-p/1522265#M600370</guid>
      <dc:creator>juleshartley</dc:creator>
      <dc:date>2024-11-16T04:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Strange date result SQL script</title>
      <link>https://community.qlik.com/t5/QlikView/Strange-date-result-SQL-script/m-p/1522293#M600371</link>
      <description>&lt;P&gt;QlikView uses "duck typing" where it will treat the field like whatever it looks to be.&amp;nbsp; Since you have a combination of numbers and dates, it treats it like the date, but when it's only the number, it treats it like a number.&amp;nbsp; A single column will only be cast as one data type--so when you have a combination of multiple, it's going to choose one or the other, not both.&amp;nbsp; It's really poor design that there is a mixture of two data types in a single column in your SQL view--those zeroes really should be NULL values.&amp;nbsp; If you're unable to update the view itself, I would add a case statement to your SQL script to update those zeroes to NULLs, then everything should flow through properly.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 17:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Strange-date-result-SQL-script/m-p/1522293#M600371</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2018-12-18T17:49:54Z</dc:date>
    </item>
  </channel>
</rss>

