English

How To: Select ArcGIS records that contain odd or even values in a numeric field

Summary

Instructions provided describe how to select records that contain odd or even values in a numeric field for use in Select by Attributes, SQL Query, and/or Label Expression dialog boxes.

Note:
The content in this article pertains to ArcGIS versions 9.x. Later versions of ArcGIS may contain different functionality, as well as different names and locations for menus, commands and geoprocessing tools.

Procedure

Use the following expression to select records with even values in a numeric field.
For personal geodatabases:

[FIELD NAME]/2 MOD 2

For shapefiles and file geodatabases:

MOD ("FIELD NAME",  2)  = 0

Use the following expression to select records with odd values in a numeric field.
For personal geodatabases:

[FIELD NAME] MOD 2

For shapefiles and file geodatabases:

MOD ("FIELD NAME",  2)  = 1