Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting previous record from Max

Status
Not open for further replies.

morfasie

IS-IT--Management
Mar 28, 2004
85
ZA
Hi if I have a table

Transid Balance Date
------------------------------
1 10 2004-10-01
40 430 2004-10-12
230 32 2004-10-15
255 1123 2004-10-25
------------------------------

If I get the Max(TransID) I get 255, but I want the previous one 230?

How do I get that one?

 
Have you tried this ?
SELECT Max(TransID) FROM YourTable
WHERE TransID<(SELECT Max(TransID) FROM YourTable)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top