<?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: Arcgis Pro - How to use &amp;quot;Like&amp;quot; function in definition query? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134106#M5763</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field type was always an issue as far as I know in ArcMap.&amp;nbsp; Like has never never been officially supported with a long field in any recognized SQL I know of, and Esri tries to comply with recognized SQL standards in general.&amp;nbsp; If it did not throw an error before then the Esri implementation was flawed and would not be portable outside of ArcMap.&amp;nbsp; I have always had to cast the long field to a text field to use any string comparisons such as the LIKE operator.&amp;nbsp; Even though ArcMap 10.3 includes LIKE in the query builder, it throws an error when I actually try to use Like in combination with a Long field, so it does not work in ArcMap and never should have worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a File geodatabase you would use this syntax to cast your long field to a string (making the number of characters fit your expected long values):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CAST(Long_Field AS &lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;CHARACTER(50)) LIKE '114%'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;SQL like this cannot be converted to the Clause mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;If you want to convert a text field with numbers to a numeric value so you can use mathematical expressions or numeric comparisons you would cast the value to a Float:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;CAST(Text_Field AS FLOAT) &amp;lt;= Long_Field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;This SQL could not be converted to Clause mode either.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2015 20:43:29 GMT</pubDate>
    <dc:creator>RichardFairhurst</dc:creator>
    <dc:date>2015-07-31T20:43:29Z</dc:date>
    <item>
      <title>Arcgis Pro - How to use "Like" function in definition query?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134103#M5760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the "Like" function all the time in ArcMAP definition queries.&amp;nbsp; ArcGIS Pro doesn't seem to offer this function.&amp;nbsp; It is not shown as an option in clause mode for a definition query, and if i try to type it in manually in SQL mode it gives me an error.&amp;nbsp; I use the same syntax as in ArcMap so i'm not sure why its not accepted.&amp;nbsp; For example - if i want to filter out features based on a field that begins with 114 i would use &lt;STRONG&gt;Field Like '114%' &lt;/STRONG&gt;(subbing in the name of the field of course). Pro does not accept this and tells me there is an error.&amp;nbsp; Why is this not working, and WHY is the Like function not offered in Clause Mode (contains, begins with, etc)??&amp;nbsp; Please help.&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 15:28:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134103#M5760</guid>
      <dc:creator>AliForrester</dc:creator>
      <dc:date>2015-07-31T15:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Pro - How to use "Like" function in definition query?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134104#M5761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What version of ArcGIS Pro are you using?&amp;nbsp; At version 1.1 the clauses that use LIKE in SQL mode are Begins With ('114%'), Ends With ('%114') and contains the text ('%114%').&amp;nbsp; The field has to be a text field to show these options.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I type the equivalent syntax for one of the Clause types in SQL mode it shows the correct Clause for each option when I switch back to Clause mode.&amp;nbsp; If I put in the expression Field LIKE '%1%14' in SQL mode the expression is accepted, but I cannot switch back to Clause mode, and it gives a message that "The expression cannot be edited in Clause mode".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not try this at version 1.0, so it may not have been available in that release (although I have no idea why it wouldn't have been included if it was missing)..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 15:50:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134104#M5761</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2015-07-31T15:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Pro - How to use "Like" function in definition query?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134105#M5762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field I'm trying to query is type "long" not "text".&amp;nbsp; The field type was not an issue in arcmap when using the Like function.&amp;nbsp; You're saying that it can only be used on "text" fields in Pro???&amp;nbsp; Well that's frustrating.&amp;nbsp; Thanks for the info.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 20:29:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134105#M5762</guid>
      <dc:creator>AliForrester</dc:creator>
      <dc:date>2015-07-31T20:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Pro - How to use "Like" function in definition query?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134106#M5763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field type was always an issue as far as I know in ArcMap.&amp;nbsp; Like has never never been officially supported with a long field in any recognized SQL I know of, and Esri tries to comply with recognized SQL standards in general.&amp;nbsp; If it did not throw an error before then the Esri implementation was flawed and would not be portable outside of ArcMap.&amp;nbsp; I have always had to cast the long field to a text field to use any string comparisons such as the LIKE operator.&amp;nbsp; Even though ArcMap 10.3 includes LIKE in the query builder, it throws an error when I actually try to use Like in combination with a Long field, so it does not work in ArcMap and never should have worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a File geodatabase you would use this syntax to cast your long field to a string (making the number of characters fit your expected long values):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CAST(Long_Field AS &lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;CHARACTER(50)) LIKE '114%'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;SQL like this cannot be converted to the Clause mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;If you want to convert a text field with numbers to a numeric value so you can use mathematical expressions or numeric comparisons you would cast the value to a Float:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;CAST(Text_Field AS FLOAT) &amp;lt;= Long_Field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;This SQL could not be converted to Clause mode either.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 20:43:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134106#M5763</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2015-07-31T20:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Pro - How to use "Like" function in definition query?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134107#M5764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the work around.&amp;nbsp; I actually tried the SQL expression on the "long" field in ArcMap 10.3 and it worked.&amp;nbsp; I copied and pasted it into ArcGIS Pro and got the error message.&amp;nbsp; Not sure why it worked in ArcMap and not Pro if they have the same field type rules.&amp;nbsp; In any case, thank you for your help with this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 22:25:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134107#M5764</guid>
      <dc:creator>AliForrester</dc:creator>
      <dc:date>2015-07-31T22:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Pro - How to use "Like" function in definition query?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134108#M5765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What database are you using?&amp;nbsp; If it is Access then I would expect funky SQL behaviors.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File geodatabases and SDE is all I will use for actual work.&amp;nbsp; Like with a Long field does not work with a File Geodatabase.&amp;nbsp; I just tried it in ArcMap 10.3 and got an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The explicit cast syntax I provided is not a work around.&amp;nbsp;&amp;nbsp; It is the proper SQL syntax for what you want to do.&amp;nbsp; Like is always described as a String operator and throwing an error is the proper implementation when Like is used directly with a Long field.&amp;nbsp; An implicit cast is not supposed to occur, and if it does occur for you the program is effectively inserting the cast I wrote out behind the scenes for you, which will never be a consistent behavior.&amp;nbsp; The behavior you desire is the work around to a standard SQL implementation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 23:33:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-how-to-use-quot-like-quot-function-in/m-p/134108#M5765</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2015-07-31T23:33:38Z</dc:date>
    </item>
  </channel>
</rss>

