Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attribute Max Value

Status
Not open for further replies.

BChardon

Programmer
Jun 24, 2005
4
FR
Hello everyone,

A little question :

Is there a way to create a filter to get the maximum value of an attribute NOT using a third party programming language ?

For example we have clients with an Age attribute and I'd like to get the oldest one.

Thank you very much.
 
>... NOT using a third party programming language ...
Are your using ado to search? If yes, you can consider setting "sort on" property of adocommand object, something like this.
[tt] adocommand.properties("sort on")="age"[/tt]
On the resultset, you use classic movefirst/movelast to get to the record with min-max of the attribute age.
 
To be more precise I'm using JNDI as an interface to my directory, and would like to retrieve the maximum value of a given attribute without having to make a "for" loop on all entries, using a LDAP filter. Is that possible ?

Thank you.
 
>...without having to make a "for" loop on all entries...
You won't need a for loop. It is only a move to make the pointer pointing to the first (ors.movefirst) or the last (ors.movelast) record of the resultset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top