圆通论坛

 找回密码
 立即注册
搜索
查看: 219|回复: 0

当天票数

[复制链接]

10

主题

10

帖子

52

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
52
发表于 2018-4-25 22:55:14 | 显示全部楼层 |阅读模式
--当天票数
declare @time date select @time=getdate() ;with PTMD  as(SELECT convert(float,COUNT(WAYBILL_NO)) as a FROM [ytodb].[dbo].[T_EXP_WAYBILL_CHECK]where OP_CODE='310'and AUX_OP_CODE<>'delete' and CREATE_TIME>=@time AND REMARK in ('10010001','10010002','10010003','10010016') ),zs as(SELECT convert(float,COUNT(WAYBILL_NO)) as b FROM [ytodb].[dbo].[T_EXP_WAYBILL_CHECK]
where CREATE_TIME>=@time and OP_CODE='310'and AUX_OP_CODE<>'delete')SELECT b.b AS 总票数,b.b-a.a AS 电子票数 ,a.a AS 普单票数,left((b.b-a.a)/b.b*100,4)+'%' AS 电子占比,left(100.00-left((b.b-a.a)/b.b*100,4),4)+'%' AS 普通占比 FROM PTMD a,zs b

回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

QQ|圆通论坛 ( 浙ICP备15028145号-1 )

GMT+8, 2018-7-17 02:18 , Processed in 0.727539 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表