<?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: SQL Query Error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492326#M184090</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whatever you write after the SQL SELECT will be sent to the DBMS and will not interpreted by QV (with the exception below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using functions like date() that are not known by the DBMS (and the sequence of single quotes is also problematic here).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what you want to achieve, but you can try to create two variables in your QV script (before the LOAD / SQL Select statement) that will evaluate your two dates and then use dollar sign expansion to include the values in your SELECT sent to the DMBS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A variable dollar sign expansion is executed before the string is sent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Sep 2013 09:48:12 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-09-06T09:48:12Z</dc:date>
    <item>
      <title>SQL Query Error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492323#M184087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am trying to Load Conditional data based on fromdate and todate from SQL server through DatePicker Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when try to load the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"SQL SELECT * FROM Persons WHERE DOB Between 'date(date#(99999999 - $(StartDate),'YYYYMMDD'))' and 'date(date#(99999999 - $(EndDate),'YYYYMMDD'))';"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is showing the following error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: Incorrect syntax near 'YYYYMMDD'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM Persons WHERE DOB Between 'date(date#(99999999 - 41082,'YYYYMMDD'))' and 'date(date#(99999999 - 41083,'YYYYMMDD'))'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me to sort out the error in the SQL Query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 09:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492323#M184087</guid>
      <dc:creator>techvarun</dc:creator>
      <dc:date>2013-09-06T09:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query Error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492324#M184088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Varun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QV functions can't be used under SQL command. You have to use some SQL date function. Otherwise you can load data into qv once then try to filter using qv functions like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * Where Date(.....)&amp;gt;'....';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL Select * from &amp;lt;DB&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 09:46:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492324#M184088</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-06T09:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query Error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492325#M184089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SELECT statement is evaluated by the OLE DB provider, not by QlikView. So, the QlikView Date() and Date#() functions are not available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 09:47:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492325#M184089</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-09-06T09:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query Error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492326#M184090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whatever you write after the SQL SELECT will be sent to the DBMS and will not interpreted by QV (with the exception below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using functions like date() that are not known by the DBMS (and the sequence of single quotes is also problematic here).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what you want to achieve, but you can try to create two variables in your QV script (before the LOAD / SQL Select statement) that will evaluate your two dates and then use dollar sign expansion to include the values in your SELECT sent to the DMBS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A variable dollar sign expansion is executed before the string is sent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 09:48:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492326#M184090</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-09-06T09:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query Error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492327#M184091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried this and now working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET VDate1 = Date($(StartDate),'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;LET VDate2 = Date($(EndDate),'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;SQL SELECT * FROM Persons WHERE DOB Between '$(VDate1)' and '$(VDate2)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Regards&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 09:54:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492327#M184091</guid>
      <dc:creator>techvarun</dc:creator>
      <dc:date>2013-09-06T09:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query Error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492328#M184092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for the help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 09:55:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492328#M184092</guid>
      <dc:creator>techvarun</dc:creator>
      <dc:date>2013-09-06T09:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query Error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492329#M184093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 09:55:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492329#M184093</guid>
      <dc:creator>techvarun</dc:creator>
      <dc:date>2013-09-06T09:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Query Error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492330#M184094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;load * where &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DOB&lt;/SPAN&gt;&amp;gt;=$(StartDate) and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DOB&amp;lt;&lt;/SPAN&gt;=$(EndDate);&lt;/P&gt;&lt;P&gt;"SQL SELECT * FROM Persons;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 09:59:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-Query-Error/m-p/492330#M184094</guid>
      <dc:creator>er_mohit</dc:creator>
      <dc:date>2013-09-06T09:59:30Z</dc:date>
    </item>
  </channel>
</rss>

