Select Last Record

S

Scott

I'm trying to get the last record from myTable and get myField1 and
myDateField2. I think it can be done using LAST() and also using the date
value of myDateField2, but I'm not having any luck.

Any help?

CODE ********
sSQL = "SELECT LAST(myFieldID), myField1, myDateField2 FROM myTable"
 
R

Ross

Try this, I used a query that only shows 1 record and sorted Descending.

SELECT TOP 1 tCommission.CommissionID, tCommission.CustomerName,
tCommission.DateEntered
FROM tCommission
ORDER BY tCommission.CommissionID DESC;

You need to change the SQL code to suit.

Ross
 
Top