<?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: Select by Attributes on Joined File Geodatabase Feature Classes Between Fields of Different Types in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012641#M1773</link>
    <description>&lt;P&gt;I don't really want to download a zip file, pictures might be better.&lt;/P&gt;&lt;P&gt;Can you just create a new field and run a field calculator set to python, something like: (untested and probably wrong)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def is_equal(value_str, value_int):
    if int(value_str) == value_int:
        result = 'True'
    else:
        result = 'False'
    return result &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is_equal(!yourStringField!, !yourIntField!)&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Dec 2020 14:06:48 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2020-12-29T14:06:48Z</dc:date>
    <item>
      <title>Select by Attributes on Joined File Geodatabase Feature Classes Between Fields of Different Types</title>
      <link>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012564#M1766</link>
      <description>&lt;P&gt;I am using ArcMap 10.8.1.&amp;nbsp; I have two feature classes in a local file geodatabase.&amp;nbsp; Both have an ID field of type Long, which has been indexed.&amp;nbsp; Feature class A has a Long field (AFIELD) and feature class B has a Text field (BFIELD).&amp;nbsp; I have joined A and B on ID.&amp;nbsp; Now all I want to do is select records where A.AFIELD &amp;lt;&amp;gt; B.BFIELD.&amp;nbsp; The SELECT statement always yields an error.&amp;nbsp; I have tried using CAST, CONVERT, and other workarounds, but cannot get the statement to run.&lt;/P&gt;&lt;P&gt;I have assembled a small example in the form of a map document, file geodatabase, and two feature classes.&amp;nbsp; Each feature class is indexed on ID and a join has been performed from B to A (A is the target, B is the joined).&amp;nbsp; If executed correctly, ID 10 will&amp;nbsp;&lt;EM&gt;not&lt;/EM&gt; be in the selection set because 123 = '123' but ID 20 &lt;EM&gt;will&lt;/EM&gt; be in the selection set because 45&lt;STRONG&gt;6&lt;/STRONG&gt; &amp;lt;&amp;gt; '45&lt;STRONG&gt;7&lt;/STRONG&gt;'.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2020 21:57:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012564#M1766</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-12-28T21:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select by Attributes on Joined File Geodatabase Feature Classes Between Fields of Different Types</title>
      <link>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012641#M1773</link>
      <description>&lt;P&gt;I don't really want to download a zip file, pictures might be better.&lt;/P&gt;&lt;P&gt;Can you just create a new field and run a field calculator set to python, something like: (untested and probably wrong)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def is_equal(value_str, value_int):
    if int(value_str) == value_int:
        result = 'True'
    else:
        result = 'False'
    return result &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is_equal(!yourStringField!, !yourIntField!)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 14:06:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012641#M1773</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-12-29T14:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select by Attributes on Joined File Geodatabase Feature Classes Between Fields of Different Types</title>
      <link>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012650#M1774</link>
      <description>&lt;BLOCKQUOTE&gt;I have tried using CAST, CONVERT, and other workarounds, but cannot get the statement to run.&lt;/BLOCKQUOTE&gt;&lt;P&gt;Instead of saying you tried CAST and CONVERT and they didn't work, try sharing specific examples you used with CAST and CONVERT and share the specific error messages.&lt;/P&gt;&lt;P&gt;For starters, CONVERT is not supported syntax with the file geodatabase, so you should not expect that to work.&amp;nbsp; I use CAST regularly with FGDB, so I know it can work, but I can't comment any more until I see how you are building your statements.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE&lt;/STRONG&gt;:&amp;nbsp; I did some basic testing, and this appears to be either a defect or limitation of CAST with the file geodatabase, i.e., CAST doesn't work with joined tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 15:29:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012650#M1774</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-12-29T15:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select by Attributes on Joined File Geodatabase Feature Classes Between Fields of Different Types</title>
      <link>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012666#M1776</link>
      <description>&lt;P&gt;I didn't see any issues with the CAST on either single or joined data ArcMap 10.7.1.&lt;/P&gt;&lt;P&gt;CAST( "Id" AS CHARACTER) &amp;lt;&amp;gt; "id_text"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit - actually tested on a shapefile... FGDB FC doesn't seem to work.&amp;nbsp; Maybe try a shapefile? &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 15:41:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012666#M1776</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-12-29T15:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select by Attributes on Joined File Geodatabase Feature Classes Between Fields of Different Types</title>
      <link>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012669#M1777</link>
      <description>&lt;P&gt;I just tried with 2 tables in a mobile geodatabase (SQLite) in Pro, and it works fine.&amp;nbsp; This is just another example of the long-standing poor SQL support with file geodatabases.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 16:28:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012669#M1777</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-12-29T16:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Select by Attributes on Joined File Geodatabase Feature Classes Between Fields of Different Types</title>
      <link>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012708#M1781</link>
      <description>&lt;P&gt;I appreciate all of your responses, and the time you put in to helping me.&amp;nbsp; I appreciate that&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp; tried to do the CAST in a query on a joined file geodatabase feature classes and also found that it didn't work either.&amp;nbsp; Validation. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The operation I was trying to perform was a microcosm of a project I need to do this week.&amp;nbsp; I was using file geodatabase feature classes to practice the operation I need to perform before the big day.&amp;nbsp; The actual, production feature classes are on SQL Server, and I have no doubt my query will work there.&amp;nbsp; If it's just a bug with file geodatabases, then I can live with that.&amp;nbsp; I did verify that the CAST operator works as expected when querying a feature class that is not involved in a join.&amp;nbsp; Thanks, everyone!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 18:24:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/select-by-attributes-on-joined-file-geodatabase/m-p/1012708#M1781</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-12-29T18:24:00Z</dc:date>
    </item>
  </channel>
</rss>

