|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 ly 于 2017-9-19 20:32 编辑
TRANSFORM Format(Nz(Sum([qry1].[xfje]),0),"¥0.00") AS xfje合计
SELECT [qry1].ryid, [qry1].rfkh, [qry1].xfrq, Sum([qry1].xfje) AS 合计金额
FROM
(SELECT lssj.ryid, lssj.rfkh, lssj.xfsj, DateValue([xfsj]) AS xfrq, TimeValue([xfsj]) AS xfsj2, DLookUp("sdmc","ycsd","kssj<=#" & [xfsj2] & "# And jssj>=#" & [xfsj2] & "#") AS xfsd, lssj.xfje, lssj.xffs
FROM lssj
WHERE lssj.xffs="正常消费"
) as qry1
GROUP BY [qry1].ryid, [qry1].rfkh, [qry1].xfrq
ORDER BY [qry1].xfrq
PIVOT [qry1].xfsd In ("早餐时段","午餐时段","晚餐时段","加班餐","五时段","六时段");
|
|