注册 登录
编程论坛 ASP技术论坛

asp出勤统计求助

wfdszds 发布于 2010-06-09 13:31, 616 次点击
数据库kkk.mdb
id   num    上午   下午   data
1   张三    内勤   内勤   2010-06-01
2   张三    内勤   会议   2010-06-02
3   张三    下乡   事假   2010-06-03
4   张三    会议   事假   2010-06-04
.......
如何取得2010-06-01至2010-06-30期间,张三内勤、下乡。。的天数?

比如统计2010-06-01至2010-06-04日
内勤的天数就是1.5天,事假1天,会议1天,下乡0.5天

[ 本帖最后由 wfdszds 于 2010-6-9 21:43 编辑 ]
9 回复
#2
cnfarer2010-06-09 14:01
不难吧!
#3
wfdszds2010-06-09 14:09
回复 2楼 cnfarer
应该怎么做?
#4
wfdszds2010-06-09 15:34
怎么没人理啊
#5
2010-06-09 16:28
要统计些什么?
多少次会议?
#6
wfdszds2010-06-09 16:46
比如统计2010-06-01至2010-06-04日
内勤的天数就是1.5天,事假1天,会议0.5天
#7
cnfarer2010-06-10 07:11
select num,cq,count(cq)*0.5 from (select id, num, 上午 as cq from table where data>='2010-06-01' and data<='2010-06-30' union all select id, num, 下午 as cq where data>='2010-06-01' and data<='2010-06-30') a group by num,cq

[ 本帖最后由 cnfarer 于 2010-6-10 07:12 编辑 ]
#8
wfdszds2010-06-11 16:33
回复 7楼 cnfarer
好像不行啊
#9
wfdszds2010-06-12 11:52
回复 7楼 cnfarer
thanks!
cq包括内勤、下乡、会议等等。。。
用select num,cq,count(cq)*0.5 from (select id, num, 上午 as cq from table where data>='2010-06-01' and data<='2010-06-30' union all select id, num, 下午 as cq where data>='2010-06-01' and data<='2010-06-30') a group by num,cq
怎样将内勤、下乡、会议等等合计天数分别循环计算出来?

[ 本帖最后由 wfdszds 于 2010-6-12 12:07 编辑 ]
#10
cnfarer2010-06-12 13:43
回复 9楼 wfdszds
都在里面了,你试一下看结果就知道了。
1