I am using ArcMap 10.8.1. I have two feature classes in a local file geodatabase. Both have an ID field of type Long, which has been indexed. Feature class A has a Long field (AFIELD) and feature class B has a Text field (BFIELD). I have joined A and B on ID. Now all I want to do is select records where A.AFIELD <> B.BFIELD. The SELECT statement always yields an error. I have tried using CAST, CONVERT, and other workarounds, but cannot get the statement to run.
I have assembled a small example in the form of a map document, file geodatabase, and two feature classes. 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). If executed correctly, ID 10 will not be in the selection set because 123 = '123' but ID 20 will be in the selection set because 456 <> '457'.