<?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: Definition expression Date Field Query Issue with Map Service Sublayers in ArcGIS API JS in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/definition-expression-date-field-query-issue-with/m-p/1586310#M86530</link>
    <description>&lt;P&gt;I found a solution for this. The reason why this issue is our used database is SQL Server so the syntax for definition expression [for date time] is not proper for SQL Server in export map service request so when I use this:&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;"USER_NAME = 'test' AND SIGHTING_DATE BETWEEN&amp;nbsp; CAST('2025-02-17' AS&amp;nbsp;DATE ) AND CAST('2025-02-18' AS DATE))"&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2025 13:36:19 GMT</pubDate>
    <dc:creator>MahmoudAdel1</dc:creator>
    <dc:date>2025-02-18T13:36:19Z</dc:date>
    <item>
      <title>Definition expression Date Field Query Issue with Map Service Sublayers in ArcGIS API JS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/definition-expression-date-field-query-issue-with/m-p/1586300#M86529</link>
      <description>&lt;P&gt;I have a strange issue related to set a complex definition expression with date field queries to mapservice subLayer the issue was introduced with me in arcgis sdk with ios and with kotlin as well&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then I have made sure this is not related to the sdk itself so I have tried with arcgis js api and I found out this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;- for setting the expression that includes date time queries to feature layer it works well as expected&amp;nbsp;&lt;/P&gt;&lt;P&gt;-for setting the expression that includes date time queries to map service sublayer it doesn't work as expected at all and it returns all features in layer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var dynamicMapServiceLayer = new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://myhost/server/rest/services/App/app/MapServer/1" target="_blank" rel="noopener nofollow noreferrer"&gt;https://myhost/server/rest/services/App/app/MapServer/1&lt;/A&gt;",&lt;BR /&gt;id: 'baseMap',&lt;BR /&gt;definitionExpression: "USER_NAME = 'test' AND (SIGHTING_DATE &amp;gt;= DATE '2025-02-17' AND SIGHTING_DATE &amp;lt; DATE '2025-02-18')"&lt;BR /&gt;});&lt;BR /&gt;var dynamicMapServiceLayer = new MapImageLayer({&lt;BR /&gt;url: "&lt;A href="https://myhost/server/rest/services/App/app/MapServer" target="_blank" rel="noopener nofollow noreferrer"&gt;https://myhost/server/rest/services/App/app/MapServer&lt;/A&gt;",&lt;BR /&gt;id: 'baseMap',&lt;BR /&gt;sublayers: [&lt;BR /&gt;{&lt;BR /&gt;id: 1,&lt;BR /&gt;visible: true,&lt;BR /&gt;definitionExpression: "USER_NAME = 'test' AND (SIGHTING_DATE &amp;gt;= DATE '2025-02-17' AND SIGHTING_DATE &amp;lt; DATE '2025-02-18')"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;I guess it is an issue with server of how to process definition expression for both&lt;BR /&gt;I hope to resolve this issue soon&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 12:17:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/definition-expression-date-field-query-issue-with/m-p/1586300#M86529</guid>
      <dc:creator>MahmoudAdel1</dc:creator>
      <dc:date>2025-02-18T12:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Definition expression Date Field Query Issue with Map Service Sublayers in ArcGIS API JS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/definition-expression-date-field-query-issue-with/m-p/1586310#M86530</link>
      <description>&lt;P&gt;I found a solution for this. The reason why this issue is our used database is SQL Server so the syntax for definition expression [for date time] is not proper for SQL Server in export map service request so when I use this:&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;"USER_NAME = 'test' AND SIGHTING_DATE BETWEEN&amp;nbsp; CAST('2025-02-17' AS&amp;nbsp;DATE ) AND CAST('2025-02-18' AS DATE))"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 13:36:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/definition-expression-date-field-query-issue-with/m-p/1586310#M86530</guid>
      <dc:creator>MahmoudAdel1</dc:creator>
      <dc:date>2025-02-18T13:36:19Z</dc:date>
    </item>
  </channel>
</rss>

