<?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: query Date Range syntax in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146724#M13675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And here is how I do most of mine:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;query&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DateIncident BETWEEN timestamp '"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; dom&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;byId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"StartDate"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;value &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"' AND timestamp '"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; dom&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;byId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"EndDate"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;value &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"'"&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Apr 2017 19:39:45 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2017-04-03T19:39:45Z</dc:date>
    <item>
      <title>query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146720#M13671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wondering if anyone can help with the syntax to query a date range?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;query.where = "County_Nam = '" + (dom.byId("CountyName").value) + "' AND Squad = '" + (dom.byId("Squad").value) + "' ";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;query.where = "County_Nam = '" + (dom.byId("CountyName").value) + "' AND Squad = '" + (dom.byId("Squad").value) + "' AND &lt;SPAN style="color: #ff0000;"&gt;DateIncident&amp;nbsp;= '" + (dom.byId("StartDate").value) + "' BETWEEN&amp;nbsp;DateIncident&amp;nbsp;= '" + (dom.byId("EndDate&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;").value) + "'&lt;/SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 19:04:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146720#M13671</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2017-04-03T19:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146721#M13672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; What is the underlying data database type (SQL Server, Shapefile, FGDB, Oracle, AGOL)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 19:19:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146721#M13672</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-04-03T19:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146722#M13673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We use MS SQL Server and we query our dates like so..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAMPLE&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;query&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CreatedDateTime &amp;gt;= '2017/03/27 00:00:00 AM' AND CreatedDateTime &amp;lt;= '2017/04/03 11:59:59 PM'"&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes its easier to test these things on the REST Endpoint too..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 19:27:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146722#M13673</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2017-04-03T19:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146723#M13674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SQL Server...This query works fine....just need the Date Range&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 19:37:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146723#M13674</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2017-04-03T19:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146724#M13675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And here is how I do most of mine:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;query&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DateIncident BETWEEN timestamp '"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; dom&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;byId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"StartDate"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;value &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"' AND timestamp '"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; dom&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;byId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"EndDate"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;value &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"'"&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 19:39:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146724#M13675</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-04-03T19:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146725#M13676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank Andrew....your solution worked fine...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 20:21:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146725#M13676</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2017-04-03T20:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146726#M13677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Had to add two ) &amp;nbsp;after value&amp;nbsp;for start and end date but worked great&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;dom&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #d74444; border: 0px; font-weight: inherit;"&gt;byId&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;"StartDate"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;value

&lt;/CODE&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;dom&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #d74444; border: 0px; font-weight: inherit;"&gt;byId&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;"StartDate"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;value)&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:00:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/146726#M13677</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-12-11T08:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/1183261#M77688</link>
      <description>&lt;P&gt;How would i query value less than todays date? i was trying something like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;query.where = GETDATE() &amp;gt;= "EXPIRATION_DATE"&lt;/LI-CODE&gt;&lt;P&gt;But this is not working. Any thoughts?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 18:57:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/1183261#M77688</guid>
      <dc:creator>RobertKirkwood</dc:creator>
      <dc:date>2022-06-15T18:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/1183273#M77695</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3614"&gt;@RobertKirkwood&lt;/a&gt;&amp;nbsp;GETDATE() is a SQL server function if you want the date from JS code then it would look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;query.where = "'" + new Date().toJSON().slice(0,10).replace(/-/g,'/') + "' &amp;gt;= EXPIRATION_DATE";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current date will look like "&lt;SPAN&gt;2022/06/15" based on the JS code above&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 19:39:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/1183273#M77695</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2022-06-15T19:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: query Date Range syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/1183284#M77699</link>
      <description>&lt;P&gt;that worked perfectly! Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 19:55:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-date-range-syntax/m-p/1183284#M77699</guid>
      <dc:creator>RobertKirkwood</dc:creator>
      <dc:date>2022-06-15T19:55:41Z</dc:date>
    </item>
  </channel>
</rss>

