select t1.date as DATE, t1.lupname as LUBNAME,t1.closingstock as STOCK from lub t1 INNER JOIN( select lupname, MAX(DATE) DATE from lub GROUP BY lupname) t2 ON t1.lupname=t2.lupname AND t1.date=t2.date
select t1.date as date, t1.lupname as lubname, t1.closingstock as stock from lub t1 inner join( select lupname, max(date) date from lub group by lupname) t2 on t1.lupname=t2.lupname and t1.date=t2.date order by t1.lupname
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)