HOW TO

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

Last Published: September 17, 2021

Summary

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. See the Related Information section for more current content..

The 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.

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
Note:
The MOD(integer_exp1, integer_exp2) function returns the remainder of integer_exp1 divided by integer_exp2. Refer to ArcMap: Functions for more information.

Article ID: 000010277

Software:
  • ArcMap 9 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options