<?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 SQL where clause causing reload error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295126#M109540</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; what error are you getting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it an odbc error?, or are you just not getting any lines back? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you connect and recover data from the database without your where clause?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if so can you recover the DATE field and see what the values look like inside it? how does qv see them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2011 11:54:43 GMT</pubDate>
    <dc:creator>pat_agen</dc:creator>
    <dc:date>2011-06-16T11:54:43Z</dc:date>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295122#M109536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an ODBC connection to a SAS dataset which loads successfully.&amp;nbsp; I am now trying to filter the dataset on a date field in the SQL load script but cannot get this to work.&amp;nbsp; I have the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;﻿﻿SET &lt;/STRONG&gt;DateFormat='DD/MM/YYYY';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let &lt;/STRONG&gt;MonthStart = date(MonthStart(AddMonths(Today(),-1)),'DD/MM/YYYY');&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;﻿Let &lt;/STRONG&gt;MonthEnd = date(MonthEnd(AddMonths(Today(),-1)),'DD/MM/YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ODBC CONNECT TO&lt;/STRONG&gt; &lt;EM&gt;&amp;lt;SAS Database&amp;gt;&lt;/EM&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TEST:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SQL SELECT&lt;/STRONG&gt; *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM &lt;/STRONG&gt;DATABASE.DATASET&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE &lt;/STRONG&gt;DATE BETWEEN &lt;STRONG&gt;&lt;EM&gt;$(MonthStart)&lt;/EM&gt;&lt;/STRONG&gt; AND &lt;STRONG&gt;&lt;EM&gt;$(MonthEnd);&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm assuming there is a formatting issue between the date field being read in from SAS and my comparison variable.&amp;nbsp; I've tried applying the SQL DATEPART and CONVERT functions to try to force the date into a comparable format but am getting no where.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS:&amp;nbsp; I also got a script error trying to specific fields in the select statement, i.e. "SQL SELECT DATE, VALUE....".&amp;nbsp; Is this a bug?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 10:40:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295122#M109536</guid>
      <dc:creator />
      <dc:date>2011-06-16T10:40:36Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295123#M109537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the problem may be some missing '' symbols when Qlikview obtains the value from the variable. For solving this, when constructing MonthStart and MonthEnd concatenate them in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MonthStart = Chr(39) &amp;amp; Date &amp;amp; Chr(39)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, use qlikview's debugger to check the error. Use a breakpoint when launching the query,copy the query qlikviews constructs in the debugger and try it inside an sql client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 11:16:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295123#M109537</guid>
      <dc:creator />
      <dc:date>2011-06-16T11:16:33Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295124#M109538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are you not missing a semi colon between your Load statement and your sql select statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would try with simple quotes around your variables. They contain values like 01/05/2011 and this might be causing problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would cast either the sql date to a string or the variables to dates like this, (I also don't use keywords like between in sql queries that are going through and odbc driver):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where DATE &amp;gt;= to_date('$(MonthStart)','DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and DATE &amp;lt;= to_date('$(MonthEnd)','DD/MM/YYYY')&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>Thu, 16 Jun 2011 11:20:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295124#M109538</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-06-16T11:20:59Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295125#M109539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your responses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried both of your suggestions and I'm still getting the same error.&amp;nbsp; It's frustrating that the error is not specific.&amp;nbsp; I've also tried looking in the debugger but don't see anything that gives any insight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pat.agen - yes, you're right that my example above is missing a semi-colon.&amp;nbsp; I typed out the code as couldn't copy and paste and didn't know how to add code.&amp;nbsp; I have the semi colon in my actual code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 11:41:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295125#M109539</guid>
      <dc:creator />
      <dc:date>2011-06-16T11:41:08Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295126#M109540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; what error are you getting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it an odbc error?, or are you just not getting any lines back? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you connect and recover data from the database without your where clause?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if so can you recover the DATE field and see what the values look like inside it? how does qv see them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 11:54:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295126#M109540</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-06-16T11:54:43Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295127#M109541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; The only error I get is displayed as ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SQL Error: SQL Scriptlive: SQL State: 00000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;SQL statement printed&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My SQL statement loads the data when there is no where clause, but I don't know how to display the date as Qlikview sees it because once it is loaded it is displayed as DD/MM/YYYY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:00:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295127#M109541</guid>
      <dc:creator />
      <dc:date>2011-06-16T12:00:43Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295128#M109542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Sorry, error should state "Scriptline" and not "Scriptlive".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:03:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295128#M109542</guid>
      <dc:creator />
      <dc:date>2011-06-16T12:03:13Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295129#M109543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; and this is irrespective of how you have coded the sql "where" clause?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have you tried harcoding a date just to test that you can actually write a where clause aginst your DATE field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get that to work and then get on to a substitution with a variable as you will nwo knwo the format you need to present your variable in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:09:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295129#M109543</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-06-16T12:09:48Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295130#M109544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try change "Between" to "&amp;gt;=" and "&amp;lt;=", maybe the sql native not undersand "Between".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SQL statement the sintaxe UNION not work for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:22:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295130#M109544</guid>
      <dc:creator />
      <dc:date>2011-06-16T12:22:41Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295131#M109545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I've tried the following where clauses and all produce the same error...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where DATE &amp;gt;= '01/05/2011' &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and DATE &amp;lt;= '31/05/2011'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿Where DATE &amp;gt;= date('01/05/2011','DD/MM/YYYY') &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and DATE &amp;lt;= date('31/05/2011','DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where date(DATE,'DD/MM/YYYY') &amp;gt;= date('01/05/2011','DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and date(DATE,'DD/MM/YYYY') &amp;lt;= date('31/05/2011','DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..sorry, don't know if we are going to get to the bottom of this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:29:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295131#M109545</guid>
      <dc:creator />
      <dc:date>2011-06-16T12:29:42Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295132#M109546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hi Gordon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes I am going to have to give up soon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One last try is your cast to date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date('01/05/2011','DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that should be &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;to_&lt;/STRONG&gt;date('01/05/2011','DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or at least it is when using oracle sql&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;only cast one side so you either do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where DATE&amp;nbsp; &amp;gt;= &lt;STRONG&gt;to_&lt;/STRONG&gt;date('01/05/2011','DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where &lt;STRONG&gt;to_&lt;/STRONG&gt;char(DATE,'DD/MM/YYYY') &amp;gt;= '01/05/2011'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we've gone too far to stop now!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:36:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295132#M109546</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-06-16T12:36:36Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295133#M109547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help.&amp;nbsp; Unfortunately I ready to give up right now!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We may be having a Qlikview rep here soon(ish!) so I might try to pick their brain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:43:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295133#M109547</guid>
      <dc:creator />
      <dc:date>2011-06-16T12:43:20Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295134#M109548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does you exclude the filter "Where..." the statement return any information?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:48:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295134#M109548</guid>
      <dc:creator />
      <dc:date>2011-06-16T12:48:54Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295135#M109549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I have successfully executed a where clause on the VALUE field, but it seems to be that the DATE field is in an unknown format and therefore generating a script error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:52:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295135#M109549</guid>
      <dc:creator />
      <dc:date>2011-06-16T12:52:04Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295136#M109550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can filter your table after load SQL too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TEST_TMP:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD DATE,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUE&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SQL SELECT *&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM DATABASE.DATASET&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;WHERE DATE BETWEEN $(MonthStart) AND $(MonthEnd);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD DATE, VALUES&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RESIDENT TEST_TMP&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;WHERE DATE &amp;gt;= '$(MonthStart)'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND DATE &amp;lt;= '$(MonthEnd)'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I think that problem is a datatype of this field in table. Does your SQL statement run in database?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 13:13:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295136#M109550</guid>
      <dc:creator />
      <dc:date>2011-06-16T13:13:02Z</dc:date>
    </item>
    <item>
      <title>SQL where clause causing reload error</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295137#M109551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to let you know I got this to work.&amp;nbsp; It seems that my field name DATE was a reserved word and therefore caused an error on reload.&amp;nbsp; When I changed my field name to EXTRACT_DATE and converted the Qlikview date number to a SAS date number this worked.&amp;nbsp; Code as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO &amp;lt;SAS DATASET&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let MonthsFromToday = -1;&lt;/P&gt;&lt;P&gt;Let SASDateConvert = 21916;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let MonthStart = num(date(MonthStart(AddMonths(Today(),$(MonthsFromToday),'DD/MM/YYYY')))) - $(SASDateConvert);&lt;/P&gt;&lt;P&gt;Let MonthEnd = num(date(MonthEnd(AddMonths(Today(),$(MonthsFromToday),'DD/MM/YYYY')))) - $(SASDateConvert);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEST:&lt;/P&gt;&lt;P&gt;LOAD EXTRACT_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUE;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM DATABASE.DATASET&lt;/P&gt;&lt;P&gt;Where EXTRACT_DATE &amp;gt;= $(MonthStart)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and EXTRACT_DATE &amp;lt;= $(MonthEnd);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2011 10:21:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-where-clause-causing-reload-error/m-p/295137#M109551</guid>
      <dc:creator />
      <dc:date>2011-06-17T10:21:05Z</dc:date>
    </item>
  </channel>
</rss>

