<?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: Re: Date in SELECT statement - QV script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609112#M681232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andreas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to use the current date of today.&lt;/P&gt;&lt;P&gt;I'm loading from my DB and I want to add a column with the current date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This script will load every day and will be stored into a QVD file with use of the CONCATENATE function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Apr 2014 13:38:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-07T13:38:53Z</dc:date>
    <item>
      <title>Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609106#M681224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'm stuck with a problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I want to use the current date (7-4-2014) in my SELECT statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Codetracker:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style=": ; color: #0000ff;"&gt;SQL&lt;/STRONG&gt; &lt;BR /&gt;&lt;BR /&gt;SELECT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Code,&lt;BR /&gt;Count(Code) as aantal,&lt;BR /&gt;&lt;SPAN style="color: #575757; text-decoration: underline;"&gt;&lt;STRONG&gt;CurrentDate()&lt;/STRONG&gt;&lt;/SPAN&gt; as afldatum&lt;BR /&gt;FROM DATASTORE.dbo."DS_ORDRS"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;WHERE &lt;/SPAN&gt;Code not in (0,99) &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have searched on the internet to find the solution, but all I can find is how to use date outside QV script, or in the WHERE statement in SQL script.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Anyone know how I can solve this?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 11:18:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609106#M681224</guid>
      <dc:creator />
      <dc:date>2014-04-07T11:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609107#M681225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Today() as afldatum,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(Code) as aantal&lt;/P&gt;&lt;P&gt;Group By Code;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;Code&lt;BR /&gt;FROM DATASTORE.dbo."DS_ORDRS"&lt;/P&gt;&lt;P&gt;WHERE Code not in (0,99) &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 11:34:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609107#M681225</guid>
      <dc:creator />
      <dc:date>2014-04-07T11:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609108#M681226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's not working.&lt;/P&gt;&lt;P&gt;It gives me an error of incorrect syntax (no FROM after the first LOAD?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to give only the important part of the statement, but maybe that's confusing. So this is the whole SQL SELECT:&lt;BR /&gt;Today() doesn't work in SQL, so how can I put today's date on the 7-4-2014 line?&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;BR /&gt;Select Zuil,&lt;BR /&gt;Code,&lt;BR /&gt;Count(Code) as aantal,&lt;BR /&gt;'7-4-2014' as afldatum&lt;BR /&gt;&lt;BR /&gt;FROM DATASTORE.dbo."DS_ORDRS"&lt;BR /&gt;Where Code not in (0,99)&lt;BR /&gt;and right (Zuil,1) in (3,7)&lt;BR /&gt;group by Zuil, Code&lt;BR /&gt;Order by Zuil, Code&lt;BR /&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;PS: This works. But I need a dump every day, so that's why I need a funtion as Today()&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 12:04:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609108#M681226</guid>
      <dc:creator />
      <dc:date>2014-04-07T12:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609109#M681227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you want current date (and / or time) in sql please let we know for which database &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sql server&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt; getdate()&lt;/P&gt;&lt;P&gt;oracle&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt; sysdate&lt;/P&gt;&lt;P&gt;etc....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 12:05:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609109#M681227</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-04-07T12:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609110#M681228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use the OLE DB Connect in Qlikview.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 12:58:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609110#M681228</guid>
      <dc:creator />
      <dc:date>2014-04-07T12:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609111#M681230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;try preceding load of data with 'where' in 2. load&lt;/P&gt;&lt;P&gt;like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(F1_Date) as DATE_NEW,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; F2&lt;/P&gt;&lt;P&gt;Where Date(F1_Date)='07.04.2014';&lt;/P&gt;&lt;P&gt;Load *&amp;nbsp; Inline&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [F1_Date, F2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01.01.2014,10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02.01.2014,20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 07.04.2014,70];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 13:02:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609111#M681230</guid>
      <dc:creator>qvwarning</dc:creator>
      <dc:date>2014-04-07T13:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609112#M681232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andreas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to use the current date of today.&lt;/P&gt;&lt;P&gt;I'm loading from my DB and I want to add a column with the current date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This script will load every day and will be stored into a QVD file with use of the CONCATENATE function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 13:38:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609112#M681232</guid>
      <dc:creator />
      <dc:date>2014-04-07T13:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609113#M681234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravis code works.&lt;/P&gt;&lt;P&gt;"Today() doesn't work in SQL, so how can I put today's date on the 7-4-2014 line?"&lt;/P&gt;&lt;P&gt;Look at his example again:&lt;/P&gt;&lt;P&gt;Today() is called in the LOAD section, NOT in the SQL SELECT section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;Load Code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Today() as afldatum,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Count(Code) as aantal&lt;/P&gt;&lt;P&gt;Group By Code;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;Code&lt;BR /&gt;FROM DATASTORE.dbo."DS_ORDRS"&lt;/P&gt;&lt;P&gt;WHERE Code not in (0,99) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 14:03:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609113#M681234</guid>
      <dc:creator>jerrysvensson</dc:creator>
      <dc:date>2014-04-07T14:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609114#M681235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the script below get values from today only.&lt;/P&gt;&lt;P&gt;you get the dimension DATE_Today with current date.&lt;/P&gt;&lt;P&gt;then load the qvd und concatenate with preceding load [ValueToday]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 14:04:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609114#M681235</guid>
      <dc:creator>qvwarning</dc:creator>
      <dc:date>2014-04-07T14:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Date in SELECT statement - QV script</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609115#M681236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the help guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found a different solution on the community, using a variable in the SQL statement.&lt;/P&gt;&lt;P&gt;So I didn't check the last two solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the solution I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vToday&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;();&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;Select Zuil,&lt;BR /&gt;Code,&lt;BR /&gt;Count(Code) as aantal,&lt;BR /&gt;'$(vToday)' as AflDat&lt;BR /&gt;&lt;BR /&gt;FROM DATASTORE.dbo."DS_ORDRS"&lt;BR /&gt;Where Code not in (0,99)&lt;BR /&gt;and right (Zuil,1) in (3,7)&lt;BR /&gt;group by Zuil, Code&lt;BR /&gt;Order by Zuil, Code&lt;BR /&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 14:21:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-SELECT-statement-QV-script/m-p/609115#M681236</guid>
      <dc:creator />
      <dc:date>2014-04-07T14:21:57Z</dc:date>
    </item>
  </channel>
</rss>

