<?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: SUBSTRING SQL Expression in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/substring-sql-expression/m-p/200415#M2142</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think the label expressions take SQL expressions, only Jscript, python, and VBscript&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For what you want you can use python and check advanced and put in this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;def FindLabel ( [[SITE_ADDRE] ): &amp;nbsp; return [SITE_ADDRE][0:6] &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;The [0:6] is an index which return the the values of the string values in your field, from the first(python is zero indexed so first thing is 0) up to 6, but not including it.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should return the first 6 characters of your field value.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2014 19:03:57 GMT</pubDate>
    <dc:creator>IanMurray</dc:creator>
    <dc:date>2014-06-11T19:03:57Z</dc:date>
    <item>
      <title>SUBSTRING SQL Expression</title>
      <link>https://community.esri.com/t5/mapping-questions/substring-sql-expression/m-p/200414#M2141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not having much experience in SQL or Python, I'm trying to take a shot at labeling a field using a SUBSTRING expression to return only the first 6 characters of a field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The field is [SITE_ADDRE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My expression looks like this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SUBSTRING ([SITE_ADDRE] FROM 1 FOR 6)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm getting an error message so I know this is incorrect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions would be much appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 18:24:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/substring-sql-expression/m-p/200414#M2141</guid>
      <dc:creator>ToddCalico</dc:creator>
      <dc:date>2014-06-11T18:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSTRING SQL Expression</title>
      <link>https://community.esri.com/t5/mapping-questions/substring-sql-expression/m-p/200415#M2142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think the label expressions take SQL expressions, only Jscript, python, and VBscript&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For what you want you can use python and check advanced and put in this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;def FindLabel ( [[SITE_ADDRE] ): &amp;nbsp; return [SITE_ADDRE][0:6] &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;The [0:6] is an index which return the the values of the string values in your field, from the first(python is zero indexed so first thing is 0) up to 6, but not including it.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should return the first 6 characters of your field value.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 19:03:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/substring-sql-expression/m-p/200415#M2142</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-06-11T19:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSTRING SQL Expression</title>
      <link>https://community.esri.com/t5/mapping-questions/substring-sql-expression/m-p/200416#M2143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great thank you so much!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 19:08:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/substring-sql-expression/m-p/200416#M2143</guid>
      <dc:creator>ToddCalico</dc:creator>
      <dc:date>2014-06-11T19:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: SUBSTRING SQL Expression</title>
      <link>https://community.esri.com/t5/mapping-questions/substring-sql-expression/m-p/200417#M2144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Actually, we have had alot of threads about how to format labels with python(and other means).&amp;nbsp; Always be sure to check the forums for similar posts, before starting a new one.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 19:20:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/substring-sql-expression/m-p/200417#M2144</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-06-11T19:20:20Z</dc:date>
    </item>
  </channel>
</rss>

