年度汇总查询:
SELECT 产品名称, Format([发货日期],"yy") AS 年度, Sum(数量) AS 数量合计, Round(Sum([单价]*[数量])/Sum([数量]),2) AS 平均单价
FROM 产品表
GROUP BY 产品名称, Format([发货日期],"yy");
月度汇总查询:
SELECT 产品名称, Format([发货日期],"yymm") AS 月度, Sum(数量) AS 数量合计, Round(Sum([单价]*[数量])/Sum([数量]),2) AS 平均单价
FROM 产品表
GROUP BY 产品名称, Format([发货日期],"yymm");