<?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 Query to find where first character = 'XYZ' in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11168#M121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"FEATURE_TYPE" LIKE 'Y%'&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Feb 2017 05:53:47 GMT</pubDate>
    <dc:creator>JayantaPoddar</dc:creator>
    <dc:date>2017-02-07T05:53:47Z</dc:date>
    <item>
      <title>Definition Query to find where first character = 'XYZ'</title>
      <link>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11166#M119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wondering if there is an easy way in the Query Builder to create a definition Query where the attributes first character starts with X??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just for an example, in the below screenshot how would one create a query to return all features where the Feature_Type starts with the letter 'Y'?? At this stage it would only show YARRAMBA CRES. and YARRUNGA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking something like using LEFT(FEATURE_TYPE,1) = 'Y' but this is invalid, I am assuming there is some other easy way that I cannot think of at 5pm in the afternoon!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/tag/sql/tg-p"&gt;#sql&lt;/A&gt;‌ &lt;A href="https://community.esri.com/t5/tag/definition query./tg-p"&gt;#definition query.&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/316457_pastedImage_1.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 05:44:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11166#M119</guid>
      <dc:creator>BenVan_Kesteren1</dc:creator>
      <dc:date>2017-02-07T05:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Query to find where first character = 'XYZ'</title>
      <link>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11167#M120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FEATURE_TYPE LIKE 'Y%'&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FEATURE_TYPE LIKE 'YAR%'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The % is used as a wildcard and can be placed behind or in front of the text you want to match&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;e.g.&amp;nbsp;FEATURE_TYPE LIKE '%CRES'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 05:50:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11167#M120</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2017-02-07T05:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Query to find where first character = 'XYZ'</title>
      <link>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11168#M121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"FEATURE_TYPE" LIKE 'Y%'&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 05:53:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11168#M121</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2017-02-07T05:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Query to find where first character = 'XYZ'</title>
      <link>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11169#M122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I knew it was too close to finish time to be trying to think of something simple like that! haha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 05:54:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11169#M122</guid>
      <dc:creator>BenVan_Kesteren1</dc:creator>
      <dc:date>2017-02-07T05:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Definition Query to find where first character = 'XYZ'</title>
      <link>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11170#M123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Like and wildcard expression is the easiest to use if you want to match a given portion of a set string. &amp;nbsp;However, there is a way to write code that is like your original approach, but the expression is not LEFT, it is SUBSTRING (at least for file geodatabases and shapefiles). &amp;nbsp;The basic syntax is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;SUBSTRING&lt;/SPAN&gt;&lt;EM style="color: #4d4d4d; background-color: #ffffff;"&gt;(string_exp&lt;/EM&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt; FROM&lt;/SPAN&gt;&lt;EM style="color: #4d4d4d; background-color: #ffffff;"&gt; start&lt;/EM&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt; FOR &lt;/SPAN&gt;&lt;EM style="color: #4d4d4d; background-color: #ffffff;"&gt;length)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #4d4d4d; background-color: #ffffff;"&gt;So for your problem it would be:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #4d4d4d; background-color: #ffffff;"&gt;&lt;SPAN&gt;SUBSTRING&lt;/SPAN&gt;&lt;EM&gt;(&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;FEATURE_TYPE&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;FROM&lt;/SPAN&gt;&lt;EM&gt; 1&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;FOR 1&lt;/SPAN&gt;&lt;EM&gt;) = 'Y'&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #4d4d4d; background-color: #ffffff;"&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #4d4d4d; background-color: #ffffff;"&gt;&lt;EM&gt;Your title suggested you wanted to find any string that began with X, Y or Z. &amp;nbsp;That could be done with this expression:&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #4d4d4d; background-color: #ffffff;"&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d;"&gt;&lt;EM style="color: #4d4d4d; background-color: #ffffff;"&gt;&lt;SPAN&gt;SUBSTRING&lt;/SPAN&gt;&lt;EM&gt;(&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;FEATURE_TYPE&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;FROM&lt;/SPAN&gt;&lt;EM&gt; 1&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;FOR 1&lt;/SPAN&gt;&lt;EM&gt;) IN ('X', 'Y', 'Z')&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 15:39:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/definition-query-to-find-where-first-character-xyz/m-p/11170#M123</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2017-02-07T15:39:30Z</dc:date>
    </item>
  </channel>
</rss>

