michalis

SearchCursor Peculiarity when including Query

Discussion created by michalis on Jan 30, 2012
Latest reply on Jan 30, 2012 by michalis
I have a feature class in a file geodatabase, that includes some NULL fields.

In ArcMap, when I write the query
[TransDate] IS NOT NULL AND ( [Latitude] IS NOT NULL OR [Longtitude] IS NOT NULL)
, I get 13,567 results (which is great).

Now switch to Python, and run a SearchCursor that only reads those selected ones...
sCur = arcpy.SearchCursor(inFC, '"TransDate" IS NOT NULL AND ("Latitude" IS NOT NULL OR "Longitude" IS NOT NULL)', "", "", "TransDate A")
, which returns 16,246.

I don't understand what the problem is in this case. I thought the quotation marks around the field could be the problem, but altering those does not fix my problem.

So I need to be able to get consistent results between a regular query in ArcMap and the query in a SearchCursor, and no amount of trying seems to work. Any suggestions anyone?

Outcomes