out-of-box way to find the maximum value of a field in a table?

3229
5
Jump to solution
07-10-2012 07:48 AM
SuiHuang
Occasional Contributor II
Hi Everybody:

    In ArcObjects 10 code, I want to query the maximum value of a field of a table in GeoDatabase (file geodatabase for now). The available method currently in my mind is to loop through every record and judge the maximum value in the code. Is there better way to make it more convenient? Is there any interface to let me do aggregate search (MAX, MIN, Count, etc.)?
    Thank you!
0 Kudos
1 Solution

Accepted Solutions
DuncanHornby
MVP Notable Contributor
Sui,

You want to be using the IDataStatistics Interface.

Duncan

View solution in original post

0 Kudos
5 Replies
DuncanHornby
MVP Notable Contributor
Sui,

You want to be using the IDataStatistics Interface.

Duncan
0 Kudos
SuiHuang
Occasional Contributor II
Sui,

You want to be using the IDataStatistics Interface.

Duncan


Thank you!
0 Kudos
RichWawrzonek
Occasional Contributor
Sui- I noticed you have never accepted an answer to your posted questions. I'm not in the hunt for any point awards, but I'm sure there are many here who would appreciate some recognition for using their valuable time to help you.
0 Kudos
MichaelRobb
Occasional Contributor III
IDataStatistics is one way or
One could also simply sort (using decending) the field and grab the first row value.
0 Kudos
SuiHuang
Occasional Contributor II
Sui- I noticed you have never accepted an answer to your posted questions. I'm not in the hunt for any point awards, but I'm sure there are many here who would appreciate some recognition for using their valuable time to help you.

Hi richwawr:

    Thank you for letting me know. Before I just clicked the upper arrow the increase the count of answers and through that's the process of accepting answer. Now I notice that there is a tick underneath for me to click and accept. I will accept the answers in my previous questions. Thank you again for letting me know.

Sui
0 Kudos