AnsweredAssumed Answered

Select Layer By attribute with a variable and null values

Question asked by ionarawilson on Jul 25, 2013
Latest reply on Aug 2, 2013 by ionarawilson
The following snippet works fine if there are no null values for the SequenceNumber field on the table, but it crashes if there are any. Is there any way to change this query? I am thinking that null values cannot be used as strings? Is there any way to create this selection query keeping the maxValue4 an integer? Thank you!
 if  result > 1:         maxValue4 = arcpy.SearchCursor("TMP", "", "", "", "SequenceNumber D").next().getValue("SequenceNumber")         arcpy.AddMessage(str(maxValue4))         query = "SequenceNumber = "         arcpy.SelectLayerByAttribute_management("TMP",  "SUBSET_SELECTION", "SequenceNumber = " +  str(maxValue4))     result = int(arcpy.GetCount_management("TMP").getOutput(0))

Outcomes