Results 1 to 2 of 2

Thread: Probably an easy SQL statement question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309
    I have a table with the following datatypes:
    IDNum, Body, Code

    I want to get the body from the table with a certain code but with the highest IDNum.

    I don't want to get a whole recordset and sort it but I just want to retrieve that one record (body)

    So is it something like this ?:

    "Select Body From Table WHERE Code is 3.3 and ???"

    How do I fix this sql string to make it work for me ?

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    give this a shot

    SQL = "SELECT * FROM mytable WHERE IDnum = (SELECT max(idNum) from mytable)"

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