Link to home
Start Free TrialLog in
Avatar of JohnMac328
JohnMac328Flag for United States of America

asked on

Coldfusion CS3 - Display most recent record

This isn't too difficult but the syntax errors are bothersome.  I am retrieving the latest record by ID but all the records are displaying.

select * from #vTableName# ORDER BY ID desc

I have tried TOP 1 and MAX but it won't make it through the syntax error.  What would be the correct statement?

Thanks,
John
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Though ID numbers can be recycled, so I usually prefer to order by a datetime stamp column.
Avatar of JohnMac328

ASKER

Thanks, I knew I was close but got too frustrated.