I am trying to create a query for the select by attribute function within a Python script.This is my current code.
lot = '96'
dp = 756421
lotFile = "D:\\NCT_GIS\\DATA\\Regional_55.gdb\\Murray\\cadastre"
arcpy.MakeFeatureLayer_management(lotFile, "lot_lyr")
arcpy.SelectLayerByAttribute_management("lot_lyr", "NEW_SELECTION", "\"LOTNUMBER\" = " + lot + " AND " + "\"PLANNUMBER\" = " + str(dp))
Unfortunately I cannot concatenate and integer and if I convert DP to a string then the query is invalid as the PLANNUMBER field is numeric whilst LOTNUMBER is text.
Does anyone know how to get the variables into the query properly so that I can input any lot and dp as this will eventually become an addin where users can specify which land parcel they are interested in.