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.

Procedure

  • Use the following expression to select records with even values in a numeric field.

    For personal geodatabases:

    Code:
    [FIELD NAME]/2 MOD 2

    For shapefiles and file geodatabases:

    Code:
    MOD ("FIELD NAME", 2) = 0

  • Use the following expression to select records with odd values in a numeric field.

    For personal geodatabases:

    Code:
    [FIELD NAME] MOD 2

    For shapefiles and file geodatabases:

    Code:
    MOD ("FIELD NAME", 2) = 1