回答編集履歴

1

追記

2019/10/15 09:27

投稿

退会済みユーザー
test CHANGED
@@ -14,9 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- // 日別ごとに格納と言うけれど、示されていないので知らん。よしなにやってくれ。
18
-
19
- $sql = "SELECT sum(complete) as complete, sum(profit) as profit FROM report WHERE date LIKE ? GROUP BY {年月日}";
17
+ $sql = "SELECT sum(complete) as complete, sum(profit) as profit FROM report WHERE date LIKE ? GROUP BY YEAR(`date`), MONTH(`date`)";
20
18
 
21
19
  $stmt = $dsn->prepare($sql);
22
20