<?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: Date in the Where Clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387564#M702010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, it's giving me this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unexpected token: '2012-10-05T00:00:00Z'&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM Case&lt;/P&gt;&lt;P&gt;Where ClosedDate &amp;gt; '' AND ClosedDate &amp;lt;= '2012-10-05 00:00:00'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #333333;"&gt;This is the revised code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Let vToday = Timestamp(Today(), 'YYYY-MM-DD 00:00:00');&lt;BR /&gt;Let vMStart = Timestamp(MonthStart(Today(), 'YYYY-MM-DD 00:00:00'));&lt;BR /&gt;LOAD *;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM Case&lt;BR /&gt;Where ClosedDate &amp;gt; $(vMStart) AND ClosedDate &amp;lt;= $(vToday);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Oct 2012 18:37:30 GMT</pubDate>
    <dc:creator>shilpan</dc:creator>
    <dc:date>2012-10-05T18:37:30Z</dc:date>
    <item>
      <title>Date in the Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387560#M702006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to Qlikview. I've been trying to add date range in the where clause, and it is not working. Please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;CUSTOM CONNECT TO "Provider=SalesForceDLL.dll;T21;XUserId=BESWWZBNJDbAXQZNOZacCYFMULZYGANOVTbIHZVOTDdcSRdNNTLGGYJOOBcEXSBOSbbIGRD;XPassword=TQaULZFMNLYIWQFGQZMKTZET;";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Let vToday = Date(Today(), 'YYYY-MM-DD');&lt;BR /&gt;Let vMonthStart = Date(MonthStart(Today(), 'YYYY-MM-DD'));&lt;BR /&gt;Let vMStart = '2012-09-01';&lt;BR /&gt;//LOAD *&lt;BR /&gt;//FROM Case&lt;BR /&gt;//Where ClosedDate &amp;gt; '$(vMonthStart)' AND ClosedDate &amp;lt;= '$(vToday)';&lt;/P&gt;&lt;P&gt;LOAD *;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM Case&lt;BR /&gt;Where ClosedDate &amp;gt; '$(vMStart)' AND ClosedDate &amp;lt;= '$(vToday)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the runtime error message I get:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;﻿&lt;SPAN id="mce_marker"&gt;&lt;/SPAN&gt;Value for the filter criterion for the field 'ClsoedDate' must be of type Datetime and should not be enclosed in the quotes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #993366;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;I tried without quotes, and it is not working either.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #993366;"&gt;﻿&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;STRONG style="color: #993366;"&gt;Thanks,&lt;BR /&gt;Shilpan&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 16:51:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387560#M702006</guid>
      <dc:creator>shilpan</dc:creator>
      <dc:date>2012-10-05T16:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Date in the Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387561#M702007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure your vMStart and vToday variables are in the same date format as ClosedDate is in your database.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 16:59:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387561#M702007</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-10-05T16:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date in the Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387562#M702008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is in the same format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2011-09-06T20:36:38.000Z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shilpan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 18:24:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387562#M702008</guid>
      <dc:creator>shilpan</dc:creator>
      <dc:date>2012-10-05T18:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Date in the Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387563#M702009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SFDC is expecting a Datetime, you need to format using Qlikview Timestamp. Should be:&lt;/P&gt;&lt;P&gt;YYYY-MM-DD 00:00:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 18:28:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387563#M702009</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-10-05T18:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Date in the Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387564#M702010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, it's giving me this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unexpected token: '2012-10-05T00:00:00Z'&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM Case&lt;/P&gt;&lt;P&gt;Where ClosedDate &amp;gt; '' AND ClosedDate &amp;lt;= '2012-10-05 00:00:00'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #333333;"&gt;This is the revised code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Let vToday = Timestamp(Today(), 'YYYY-MM-DD 00:00:00');&lt;BR /&gt;Let vMStart = Timestamp(MonthStart(Today(), 'YYYY-MM-DD 00:00:00'));&lt;BR /&gt;LOAD *;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM Case&lt;BR /&gt;Where ClosedDate &amp;gt; $(vMStart) AND ClosedDate &amp;lt;= $(vToday);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 18:37:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387564#M702010</guid>
      <dc:creator>shilpan</dc:creator>
      <dc:date>2012-10-05T18:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Date in the Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387565#M702011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't appear to be getting a good value for vMStart. I don't see anything wrong with the example you posted, but verify that in your actual code the spelling and case is exactly the same in your Let and the reference in the SQL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 21:09:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/387565#M702011</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-10-05T21:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date in the Where Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/1681731#M702012</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;It's great that things worked out for you using &lt;U&gt;&lt;STRONG&gt;Timestamp&lt;/STRONG&gt;&lt;/U&gt;, but if you would still like to use &lt;U&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt; &lt;/U&gt;function for the where clause, please use &lt;U&gt;&lt;STRONG&gt;like&lt;/STRONG&gt;&lt;/U&gt; function in the where clause.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EX:&amp;nbsp;&lt;/P&gt;&lt;P&gt;where FileDate1 like Date(WeekStart(Today()))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FileDate1 is a date. something like "02/02/2020"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Manan Mehta&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 15:10:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-in-the-Where-Clause/m-p/1681731#M702012</guid>
      <dc:creator>mananmehta900</dc:creator>
      <dc:date>2020-03-04T15:10:10Z</dc:date>
    </item>
  </channel>
</rss>

