Query script error

Please apply it.

SELECT max(total)
FROM `tabSales Invoice` 
WHERE posting_date = CURDATE();

Another reference: Stock report issue - #4 by NCP