帖子上移 如何在Access中实现以下计算,谢谢请看附件
时间:2011-05-26
来源:互联网
如何在Access中实现以下计算,每月自动计算年累计GOP%,后当月GOP * 相应的Fee% - 上月的预提Fee,
结果为 年累计Fee = 年累计GOP * 相应的Fee%.
请看附件
Month Revenue GOP GOP% Fee Fee Fee% GOP
1 10000 1000 10.0% 50 5.0% 0.0%
2 12000 2000 13.6% 100 6.0% 30.0%
3 13500 7000 28.2% 350 7.0% 40.0%
4 14000 2000 24.2% 100
5 8000 3000 26.1% 150
6 50000 30000 41.9% 2400
Fee Cal.rar(1.77 KB)
结果为 年累计Fee = 年累计GOP * 相应的Fee%.
请看附件
Month Revenue GOP GOP% Fee Fee Fee% GOP
1 10000 1000 10.0% 50 5.0% 0.0%
2 12000 2000 13.6% 100 6.0% 30.0%
3 13500 7000 28.2% 350 7.0% 40.0%
4 14000 2000 24.2% 100
5 8000 3000 26.1% 150
6 50000 30000 41.9% 2400
附件

2011-5-26 14:54, 下载次数: 4
作者: felixtian 发布时间: 2011-05-26
为了简化查询,分拆之(不用能%,改了):
一、select month,revenue,gop,
((select sum(gop) from tb where month<=a.month)/(select sum(revenue) from tb where month<=a.month)) as [gop%]
from tb a
二、select month,revenue,gop,[gop%],
iif([gop%]<0.30,0.05,iif([gop%]<0.40,0.06,0.07))*(select sum(gop) from tb where month<=a.month) as Freet
from 查询一 a
三、select month,revenue,gop,[gop%],
Freet-(select max(Freet) from 查询二 where month<a.month) as Free
from 查询二 a
[ 本帖最后由 marco 于 2011-5-26 17:39 编辑 ]
一、select month,revenue,gop,
((select sum(gop) from tb where month<=a.month)/(select sum(revenue) from tb where month<=a.month)) as [gop%]
from tb a
二、select month,revenue,gop,[gop%],
iif([gop%]<0.30,0.05,iif([gop%]<0.40,0.06,0.07))*(select sum(gop) from tb where month<=a.month) as Freet
from 查询一 a
三、select month,revenue,gop,[gop%],
Freet-(select max(Freet) from 查询二 where month<a.month) as Free
from 查询二 a
[ 本帖最后由 marco 于 2011-5-26 17:39 编辑 ]
作者: marco 发布时间: 2011-05-26
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28