Forum Moderators: open
SELECT
DATE_FORMAT (pj_start_date, '%Y-%m') AS 'Month'
,SUM (pj_paid_to_date) AS 'Project Total'
,(SELECT SUM (credit) AS 'Credit Total'
FROM tbl_finance
WHERE DATE_FORMAT (pj_start_date, '%Y-%m') = DATE_FORMAT (account_date, '%Y-%m'))
FROM tbl_projects pjUNION
SELECT
DATE_FORMAT (tf2.account_date, '%Y-%m') AS 'Month'
,0
,SUM (tf2.credit) AS 'Credit Total'
FROM tbl_finance AS tf2
WHERE NOT EXISTS (
SELECT 1
FROM tbl_projects AS tp2
WHERE DATE_FORMAT (tp2.pj_start_date, '%Y-%m') = DATE_FORMAT (tf2.account_date, '%Y-%m') )
GROUP BY 'Month'
I carn't see anything wrong HELP
Here the error message:
#1305 - FUNCTION lees_pmnger.DATE_FORMAT does not exist