PDA

Click to See Complete Forum and Search --> : Probably an easy SQL statement question


Inhumanoid
Dec 21st, 2000, 04:28 AM
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 ?

kovan
Dec 21st, 2000, 07:02 AM
give this a shot

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