Within a script I create a new file, which has a dynamic value in the attribute name. This also changes the name of the attribute [FID] in each file. During a query in a file I have to use this attribute. So I have to create the field name for the query expression. But this is where I fail because of the syntax of all the quotation marks and backslashes.
The "normal" (undynamic) query would look like this:
arcpy.SelectLayerByAttribute_management( "Union", 'NEW_SELECTION', "\"FID_4113_T\" <> -1 AND \"FID_4113_L\" <> -1" )
My problem is that I cannot integrate the value of the cursor
(row.zfill(4)) into the field name