<?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 UPPER works in Filter function but TRIM doesn't in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/sql-upper-works-in-filter-function-but-trim-doesn/m-p/1363769#M7612</link>
    <description>&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I'm working on an Arcade field calculation in Field Maps. I'm working in the Map Viewer.&lt;BR /&gt;&lt;BR /&gt;This works:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var projectSoilPits = filter($featureset, "UPPER(ProjectNumber) = @projectNumber")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This doesn't :&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var projectSoilPits = filter($featureset, "TRIM(ProjectNumber) = @projectNumber")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Neither does this:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var projectSoilPits = filter($featureset, "TRIM(both ' ' from ProjectNumber) = @projectNumber")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both result in a "Failed to calculate" error when I test the form in both the Map Viewer and the mobile app.&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;Can someone please tell me why the SQL-92 UPPER function is working for me but TRIM isn't? Thanks in advance!&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 21 Dec 2023 20:45:48 GMT</pubDate>
    <dc:creator>HollyTorpey_LSA</dc:creator>
    <dc:date>2023-12-21T20:45:48Z</dc:date>
    <item>
      <title>SQL UPPER works in Filter function but TRIM doesn't</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/sql-upper-works-in-filter-function-but-trim-doesn/m-p/1363769#M7612</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I'm working on an Arcade field calculation in Field Maps. I'm working in the Map Viewer.&lt;BR /&gt;&lt;BR /&gt;This works:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var projectSoilPits = filter($featureset, "UPPER(ProjectNumber) = @projectNumber")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This doesn't :&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var projectSoilPits = filter($featureset, "TRIM(ProjectNumber) = @projectNumber")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Neither does this:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var projectSoilPits = filter($featureset, "TRIM(both ' ' from ProjectNumber) = @projectNumber")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both result in a "Failed to calculate" error when I test the form in both the Map Viewer and the mobile app.&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;Can someone please tell me why the SQL-92 UPPER function is working for me but TRIM isn't? Thanks in advance!&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Dec 2023 20:45:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/sql-upper-works-in-filter-function-but-trim-doesn/m-p/1363769#M7612</guid>
      <dc:creator>HollyTorpey_LSA</dc:creator>
      <dc:date>2023-12-21T20:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: SQL UPPER works in Filter function but TRIM doesn't</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/sql-upper-works-in-filter-function-but-trim-doesn/m-p/1363947#M7618</link>
      <description>&lt;P&gt;It is probably that SQL is not fully implemented in all tools.&amp;nbsp; Plus what is implemented varies between, SDE, GDB, in memory sets, AGOL, Map Viewer and ArcPro/ArcMap.&lt;/P&gt;&lt;P&gt;I have asked a few times over the years for documentation on any of this but never got a response.&amp;nbsp; Makes it hard when you are just guessing.&amp;nbsp; Sometimes the syntax is also different.&amp;nbsp; Esp true with in_memory and memory in Python.&amp;nbsp; My guess is that Arcade is also not full SQL&lt;/P&gt;&lt;P&gt;Just some of the posts on this.&amp;nbsp; Sorry not a great answer but it may be better to look for another way like contains maybe?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://resources.arcgis.com/en/help/main/10.2/index.html#/SQL_reference_for_query_expressions_used_in_ArcGIS/00s500000033000000/" target="_blank"&gt;https://resources.arcgis.com/en/help/main/10.2/index.html#/SQL_reference_for_query_expressions_used_in_ArcGIS/00s500000033000000/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many posts on this&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/cast-does-not-work-in-searchcursor-queries/m-p/264322" target="_blank"&gt;https://community.esri.com/t5/python-questions/cast-does-not-work-in-searchcursor-queries/m-p/264322&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-questions/new-map-viewer-and-classic-cannot-handle/m-p/1107089" target="_blank"&gt;https://community.esri.com/t5/arcgis-online-questions/new-map-viewer-and-classic-cannot-handle/m-p/1107089&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/data-management-questions/using-sql-cast-functionality-in-against-a-file/m-p/209575" target="_blank"&gt;https://community.esri.com/t5/data-management-questions/using-sql-cast-functionality-in-against-a-file/m-p/209575&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/are-def-query-using-sql-now-different/m-p/85499" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-questions/are-def-query-using-sql-now-different/m-p/85499&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/sql-clause-in-arcpy-da-searchcursor-is-not/m-p/51603" target="_blank"&gt;https://community.esri.com/t5/python-questions/sql-clause-in-arcpy-da-searchcursor-is-not/m-p/51603&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/geodatabase-questions/what-sql-commands-do-in-memory-workspaces-support/m-p/862454" target="_blank"&gt;https://community.esri.com/t5/geodatabase-questions/what-sql-commands-do-in-memory-workspaces-support/m-p/862454&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 14:37:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/sql-upper-works-in-filter-function-but-trim-doesn/m-p/1363947#M7618</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2023-12-22T14:37:48Z</dc:date>
    </item>
  </channel>
</rss>

