SELECT Format([Sheet2]![生产日期],"YYYY-MM") AS 生产日期, Sum(Sheet2.生产数量) AS 生产数量之总计, Count(Sheet2.生产日期) AS 生产日期之计数
FROM Sheet2
GROUP BY Format([Sheet2]![生产日期],"YYYY-MM");
把Sheet2改成你的表名称。
SELECT Format(t.生产日期,'yyyy-mm') AS 年月, Sum(t.生产数量) AS 生产总计, t1.生产计数
FROM a AS t INNER JOIN [SELECT Format(生产日期,"yyyy/mm") AS 年月, Count(*) AS 生产计数 FROM (SELECT DISTINCT 生产日期 FROM A) AS T GROUP BY Format(生产日期,"yyyy/mm")]. AS t1 ON Format(t.生产日期,'yyyy-mm')=t1.年月
GROUP BY Format(t.生产日期,'yyyy-mm'), t1.生产计数;