Results 1 to 3 of 3

Thread: Search through a table to find largest number

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    2

    Question

    hi
    i need to search through a table to find the last entered record. the records are autonumbered under the "ID" so the last record entered should have the largert "ID" number.

    i am using ado. is there a maximum function i could use???
    ex: max(recordset.fields("ID")

    or do i need to do something with an array?

    Thanks!
    jodilyn
    jodilyn

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Omaha, Ne
    Posts
    65

    Lightbulb How about

    How about something like


    rs.movelast

    (rs being your recordset)

  3. #3
    Addicted Member
    Join Date
    Jul 1999
    Location
    St-Élie d'Orford, Quebec, Canada
    Posts
    133
    Hi, try this...


    "SELECT MAX(ID) as MaxValue FROM Table"

    don't do this movelast thing because the RS will have to retreive all records before going to the last one...



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width