<?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 Oracle (SQL) Database - selecting / extracting a date (number) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882708#M655267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got an Oracle database I'm pulling data from. I run this query to get yesterdays data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;SQL&lt;/SPAN&gt;&lt;SPAN style="font-family: terminal,monaco;"&gt; select&amp;nbsp; *&amp;nbsp; from HFM_ERRORLOG where DTIMESTAMP&amp;gt;= 42166.0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and get the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/89266_pastedImage_6.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;42166 is 11/06/2015; if I put '11/06/2015' in to excel and convert the format of the cell to Number then '42166' is the number I get. The number of days since 1900 I understand. I need to modify the above select command to use a variable for "yesterdays date" so I can automate it, instead of hard-coding the number in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone know how to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2015 12:20:44 GMT</pubDate>
    <dc:creator>shane_spencer</dc:creator>
    <dc:date>2015-06-12T12:20:44Z</dc:date>
    <item>
      <title>Oracle (SQL) Database - selecting / extracting a date (number)</title>
      <link>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882708#M655267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got an Oracle database I'm pulling data from. I run this query to get yesterdays data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;SQL&lt;/SPAN&gt;&lt;SPAN style="font-family: terminal,monaco;"&gt; select&amp;nbsp; *&amp;nbsp; from HFM_ERRORLOG where DTIMESTAMP&amp;gt;= 42166.0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and get the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/89266_pastedImage_6.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;42166 is 11/06/2015; if I put '11/06/2015' in to excel and convert the format of the cell to Number then '42166' is the number I get. The number of days since 1900 I understand. I need to modify the above select command to use a variable for "yesterdays date" so I can automate it, instead of hard-coding the number in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone know how to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 12:20:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882708#M655267</guid>
      <dc:creator>shane_spencer</dc:creator>
      <dc:date>2015-06-12T12:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle (SQL) Database - selecting / extracting a date (number)</title>
      <link>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882709#M655268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In oracle sysdate is the date and time,&amp;nbsp; try this with an oracle tool (sqlplus, toad, sql developer, etc, ....)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;select to_char((sysdate), 'DD-MM-YYYY HH:MI:SS') from dual&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;select to_char(trunc(sysdate), 'DD-MM-YYYY HH:MI:SS') from dual&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so your statement should be (if &lt;SPAN style="color: #3d3d3d; font-family: terminal, monaco; font-size: 13px;"&gt;DTIMESTAMP ia an Oracle date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000080;"&gt;SQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: terminal, monaco; color: #3d3d3d;"&gt; select&amp;nbsp; *&amp;nbsp; from HFM_ERRORLOG where DTIMESTAMP&amp;gt;= (sysdate-1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: terminal, monaco; color: #3d3d3d;"&gt;or&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: terminal, monaco; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000080;"&gt;SQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: terminal, monaco; color: #3d3d3d;"&gt; select&amp;nbsp; *&amp;nbsp; from HFM_ERRORLOG where DTIMESTAMP&amp;gt;= trunc(sysdate-1);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: terminal, monaco; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;42166 is the Qlik date, I think not a valid date for Oracle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 12:29:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882709#M655268</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-06-12T12:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle (SQL) Database - selecting / extracting a date (number)</title>
      <link>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882710#M655269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried that. I think the 42166 is how the date is stored in the Oracle DB. As a NUMBER and using sysdate gives a DATE format so it fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/89271_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 12:46:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882710#M655269</guid>
      <dc:creator>shane_spencer</dc:creator>
      <dc:date>2015-06-12T12:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle (SQL) Database - selecting / extracting a date (number)</title>
      <link>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882711#M655270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;let vYestertay = floor(today(1)-1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000080;"&gt;SQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: terminal, monaco; color: #3d3d3d;"&gt; select&amp;nbsp; *&amp;nbsp; from HFM_ERRORLOG where DTIMESTAMP&amp;gt;= $(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;vYestertay)&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 13:10:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882711#M655270</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-06-12T13:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle (SQL) Database - selecting / extracting a date (number)</title>
      <link>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882712#M655271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. I did not realise I could combine the QlikView variable in the SQL select statement. I use similar variables all the time but this is the first time I've used Oracle as a source. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 13:23:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Oracle-SQL-Database-selecting-extracting-a-date-number/m-p/882712#M655271</guid>
      <dc:creator>shane_spencer</dc:creator>
      <dc:date>2015-06-12T13:23:57Z</dc:date>
    </item>
  </channel>
</rss>

