I need to add a YTD column for the attached query.
The idea is to display values for each month, but to have the sum of expenditures for the year in YTD. Thus, the WHERE clause at the query's end does not apply to the YTD column.
So, could someone please show me:
1. How to add a sub-query within this sql statement with the appropriate WHERE criterion to display YTD values.
2. An easy way in either PHP or MySQL to retrieve the first day of the year in question.
Your help is much appreciated.