I have run into this odd issue where my SQL query is accepted and run correctly through the Select by Attributes window but produce an empty output when used in the python script I'm writing. What makes this weirder is that similar queries that use '=' instead of 'LIKE' work perfectly fine in the script. I am using ArcGIS Desktop 10.8.1.
arcpy.SelectLayerByAttribute_management("T_facility", "NEW_SELECTION", "FACILITYID LIKE '%V%' OR FACILITYID LIKE '%B%'")
Even when I separately use the two qualifiers of 'V' and 'B', only 'B' produces an actual selection in the script. I should also mention that most, if not all, of the rows that I'm selecting with the 'V' qualifier have 'V' as the first character.
I had previously been using Table to Table but when that started creating empty outputs, I broke it into parts with Select by Attributes + Copy Rows. Here is an example of what previously worked (filepaths not accurate to actual script):
arcpy.TableToTable_conversion("//Documents/ArcGIS/Default.gdb/Connection", "C:\my_name\F_ID.dbf", "MidSS", "SUBTYPECODE = 4")
Does anyone have an explanation as to why these selections suddenly produce nothing through python while working manually in Select by Attributes?