SELECT TOP 1 OpeningBal FROM Ledger WHERE AccountID=123456 ORDER BY ID DESC
SELECT OpeningBal FROM Ledger WHERE ID = (SELECT MAX(ID) FROM Ledger WHERE AccountID=123456 );
"SET STATISTICS IO ON ;SET STATISTICS TIME ON
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)