How to Get Rid of Quotes in the SQL expression

Discussion created by babakkasraie on Mar 14, 2013
Latest reply on Mar 15, 2013 by babakkasraie
I have some codes in my script like this.

queryList = selectedFids.replace(';', ',')
newName = arcpy.AddFieldDelimiters(lyr, "[OBJECTID]")
lyr.definitionQuery =  '{0} in ({1})' .format(newName, queryList)

In the second line for AddFieldDElimiters properties I have to use Quotes for [OBJECTID] to work.

In my SQL query I must only use [OBJECTID] without quotes, but quotes come to my query from newName.

I need to get rid of the quotes in the sql query. How can I do that?

Please help me.

Best regards