|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 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 ("早餐时段","午餐时段","晚餐时段","加班餐","五时段","六时段");
|
|