Select to view content in your preferred language

selecting multiples of 10

9355
5
11-11-2010 06:53 AM
PamBrangan
Occasional Contributor
Hi - I have a data layer that has 5 ft contour intervals.  I would like to extract only the contours that are multiples of 10, so that I can have a data layer that is 10 ft contours.  What is the selection query I need to get this to work?

Thanks in advance for any help; I am tired of banging my head on this one!

Pam
0 Kudos
5 Replies
RichardFairhurst
MVP Alum
Hi - I have a data layer that has 5 ft contour intervals.  I would like to extract only the contours that are multiples of 10, so that I can have a data layer that is 10 ft contours.  What is the selection query I need to get this to work?

Thanks in advance for any help; I am tired of banging my head on this one!

Pam


The SQl you need is for the MOD function.  The syntax for its use depends on the database (PGDB, FGDB, SDE Oracle, etc.).  I believe the syntax for a FGDB is something like the following (assumes your contours have a field called ELEVATION):

MOD([ELEVATION], 10) = 0
PamBrangan
Occasional Contributor
Thank you Richard!  That did the trick.  I'm going to save that query for future use.
0 Kudos
MatthewLeonard
Regular Contributor

I've found using MOD doesn't quite give me the result I want. If I use MOD(FIELD_NAME, 10) = 0, values like 10.1234, 20.1234 etc. will not get filtered out. The value seems to be evaluated as an integer, so 20.1234 gets evaluated as 20, so it meets the definition query.

Instead, I use FIELD_NAME/10 = ROUND(FIELD_NAME/10,0)

RichardFairhurst
MVP Alum

The original suggestion using MOD only reliably works if the field being evaluated is a Short, Long or Big Integer field.  However, if the field being evaluated is a Float or Double and contains any values that are not whole numbers, the expression suggested by @MatthewLeonard is the way to go.

MatthewLeonard
Regular Contributor

Well yeah, since the OP asked about contours, I suppose they weren’t dealing with any float/double values.

0 Kudos