今日からの日付の差が7を超えるアイテムの合計を取得するには、mysqlステートメントを実行する必要があります(つまり、今日-7)
これは私の現在の声明です:
SELECT
COUNT(*)
FROM
complaints
WHERE
complaint_status = 'OPEN' AND
complaint_regdate <= curdate()
complaint_regdate >= DATE_SUB(curdate(),INTERVAL 7 day)
このエラーが発生します:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'complaint_regdate >= DATE_SUB(curdate(),INTERVAL 7 day)' at line 1