ADO Finding Highest Number in ADO Recordset field? 
Author Message
 ADO Finding Highest Number in ADO Recordset field?

I would like to find the highest number in a field in an ADO Record
set then add 1 to it to add a new record to the record set.  Is there
an easy way to find the highest number is a Record Set field?
Thanks



Thu, 15 Mar 2001 03:00:00 GMT  
 ADO Finding Highest Number in ADO Recordset field?
Jim,
You have a couple of options here. If you sort descending by the number in
question, then the greatest number should be in the first record. If you run
a separate aggregate query using the MAX() aggregate function to return the
single maximum value should also do the trick. This could be tricky if the
database is rapidly updated causing a different Max() value from the maximum
recordset value. A third option would be to loop the records to find the
max. If the recordset is small (~<1000 records and always will be) then this
might be an option but certainly not the first choice. Hope this helps.

Oscar Bowyer

Quote:

>I would like to find the highest number in a field in an ADO Record
>set then add 1 to it to add a new record to the record set.  Is there
>an easy way to find the highest number is a Record Set field?
>Thanks




Fri, 16 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. High number of columns with ADO Update.

2. Open ADO recordset on another ADO recordset - possible?

3. ADO ADO ADO ADO ADO VB examples / samples book wanted

4. ADO Recordset Record Number

5. ADO Problem Updating number field to Null

6. EOF with ADO by select Oracle-Number fields

7. Max number of fields in an ADO/Sql 6.5 query

8. ADO Recordset.Find question

9. ADO recordsets / FIND

10. ADO Recordset find method

11. ADO Recordset Find

12. ADO Recordset Seek or Find

 

 
Powered by phpBB® Forum Software