|
需要上个月的数据放到当月字段的后面,使用公式dlookup可以实现,但用一个dlookup查询出来后,很卡,上下滚动数据就挂了。数据量不大,也就几百行。我用的比较多dlookup更不行了。各位有可以简化的公式?或这个提示“access停止工作”是怎么回事?
SELECT
DLookUp("[会员业绩]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月会员业绩,
DLookUp("[新签会员业绩]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月新签会员业绩,
DLookUp("[续费业绩]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月续费业绩,
DLookUp("[部门人数]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月部门人数,
DLookUp("[人均开通+余额]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月人均开通与余额,
DLookUp("[人均会员业绩]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月人均会员业绩,
DLookUp("[人均余额业绩]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月人均余额业绩,
DLookUp("[人均新签业绩]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月人均新签业绩,
DLookUp("[人均续费业绩]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月人均续费业绩,
DLookUp("[新签服务量]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月新签服务量,
DLookUp("[续费服务量]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月续费服务量,
DLookUp("[新签Arpu]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月新签Arpu,
DLookUp("[续费Arpu]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月续费Arpu,
DLookUp("[打包率]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月打包率,
DLookUp("[客均打包金额]","部门1","部门='" & [部门] & "' and 月份='" & [月份]-1 & "'") AS 上月客均打包金额
FROM 部门1;
|
|