Hi,
I am trying to get the ID of the second highest record. Unfortunately, the sql-result is always empty. What is wrong with my code? Thanks for help!
FRANK
I am trying to get the ID of the second highest record. Unfortunately, the sql-result is always empty. What is wrong with my code? Thanks for help!
FRANK
Code:
Set db = CurrentDb
strSQL = "SELECT Min(QuoteID) FROM (SELECT TOP 2 * FROM Quotes ORDER BY QuoteID DESC)"
Set rs = db.OpenRecordset(strSQL) ' Recordset öffnen
var = rs!QuoteID