Forum Moderators: open
In fact the table containing my daily expenses is called "expenses". I tried to write a query like this for that issue:
I used a self-join like this:
SELECT t1.date As date, DAYNAME(t1.date) As 'Day Name', t1.amount, TRUNCATE(SUM(t2.amount), 2) As Cumulative_expense FROM expenses as t1, expenses as t2 WHERE t1.date >= t2.date GROUP BY t1.date;
In the book, I recentely followed this query produced a cumulative expense amount but fails to work for me. Can somebody point me into the right correction?
Kind regards,
Darius B.