<?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 Querying a date field, but API does not return valid matches for exact date in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/querying-a-date-field-but-api-does-not-return/m-p/1150824#M4094</link>
    <description>&lt;P&gt;Hi all, using the ArcGIS REST API, I am unable to do a date query that gets results for the exact date matching a feature's attribute. For example, I have a feature with&amp;nbsp;"created_date": 1646417844731 (2022-03-04 around 10am Pacific Time), but if I query with a 'where' param of&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;created_date = DATE '2022-03-04'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;it returns no features. This syntax SHOULD be working, according to the ArcGIS blog:&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/api-rest/data-management/querying-feature-services-date-time-queries/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/api-rest/data-management/querying-feature-services-date-time-queries/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Worth noting that the &amp;gt; and &amp;lt; operators are working exactly as expected -- both of these 'where' params return the feature I'm looking for:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;created_date &amp;lt; DATE '2022-03-05'
created_date &amp;gt; DATE '2022-03-04'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I not be using the = operator to find today's matches? Please let me know if you can spot the error here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2022 19:18:49 GMT</pubDate>
    <dc:creator>ewagstaff</dc:creator>
    <dc:date>2022-03-04T19:18:49Z</dc:date>
    <item>
      <title>Querying a date field, but API does not return valid matches for exact date</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/querying-a-date-field-but-api-does-not-return/m-p/1150824#M4094</link>
      <description>&lt;P&gt;Hi all, using the ArcGIS REST API, I am unable to do a date query that gets results for the exact date matching a feature's attribute. For example, I have a feature with&amp;nbsp;"created_date": 1646417844731 (2022-03-04 around 10am Pacific Time), but if I query with a 'where' param of&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;created_date = DATE '2022-03-04'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;it returns no features. This syntax SHOULD be working, according to the ArcGIS blog:&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/api-rest/data-management/querying-feature-services-date-time-queries/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/api-rest/data-management/querying-feature-services-date-time-queries/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Worth noting that the &amp;gt; and &amp;lt; operators are working exactly as expected -- both of these 'where' params return the feature I'm looking for:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;created_date &amp;lt; DATE '2022-03-05'
created_date &amp;gt; DATE '2022-03-04'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I not be using the = operator to find today's matches? Please let me know if you can spot the error here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 19:18:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/querying-a-date-field-but-api-does-not-return/m-p/1150824#M4094</guid>
      <dc:creator>ewagstaff</dc:creator>
      <dc:date>2022-03-04T19:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Querying a date field, but API does not return valid matches for exact date</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/querying-a-date-field-but-api-does-not-return/m-p/1499616#M4780</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/493932"&gt;@ewagstaff&lt;/a&gt;. Has this issue resolved? I am facing the same issue&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 01:33:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/querying-a-date-field-but-api-does-not-return/m-p/1499616#M4780</guid>
      <dc:creator>nutscrewbolt</dc:creator>
      <dc:date>2024-07-01T01:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Querying a date field, but API does not return valid matches for exact date</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/querying-a-date-field-but-api-does-not-return/m-p/1499635#M4781</link>
      <description>&lt;P&gt;Hey! Haven't tried recently, but the solution for me was just using greater than AND less than to get a larger set of dates and then getting exactly what I needed by parsing the date attribute myself.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 03:33:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/querying-a-date-field-but-api-does-not-return/m-p/1499635#M4781</guid>
      <dc:creator>ewagstaff</dc:creator>
      <dc:date>2024-07-01T03:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Querying a date field, but API does not return valid matches for exact date</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/querying-a-date-field-but-api-does-not-return/m-p/1701624#M5118</link>
      <description>&lt;P&gt;I'm having the same issue, using the ArcGIS API for Python and the .calculate() operation on a Feature Layer. I'm trying to recalculate records where the date field should be null/None but instead came into the service as&amp;nbsp;&lt;SPAN&gt;1969-12-31 19:00:00.000. Using &amp;gt; or &amp;lt; returns results, but using = does not. Using == doesn't work either (and throws an error)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using the where query below works fine for me in this instance, but it would be nice to know how to query for an exact match in the future.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;featureLayer.calculate(where = "last_login &amp;lt; timestamp '1970-01-01 00:00:00.100'", calc_expression = {'field': 'last_login', 'value': None})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2026 19:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/querying-a-date-field-but-api-does-not-return/m-p/1701624#M5118</guid>
      <dc:creator>AaronKoelker</dc:creator>
      <dc:date>2026-05-12T19:50:31Z</dc:date>
    </item>
  </channel>
</rss>

