What is it about the "last" record that makes it the last, in this case?
Is there a numeric PK that you can take the MAX() of, or are you going by the date? Or do you want it to figure out the latest version number?
You could use: SELECT MAX(Date) As MaxDate, Version FROM DocControl GROUP BY Version ORDER BY MAX(Date) DESC
Big problem here is the use of a reserved word for a column name. Your query may have a problem with "Date." In that case use "DocControl.Date" instead.
SELECT MAX(DocControl.Date) As MaxDate, DocControl.Version
FROM DocControl
GROUP BY Version
ORDER BY MAX(DocControlDate) DESC
Did that help?
mmcdonal
Look it up at:
http://wrox.books24x7.com