I need a query to display a value (saldo) following max date / the last date of year, but I have tried but it and it's always showing a value from the first date.
Here is my query:
SELECT saldo, MAX(tgl_lap) FROM laporan GROUP BY DATE_FORMAT(tgl_lap,'%Y','%m') ORDER BY DATE_FORMAT(tgl_lap,'%Y','%m') DESC
my result:
And my expectated result should be only showing values like in the red box below: