圆通论坛

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

普通面单、电子面单占比

[复制链接]

10

主题

10

帖子

52

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
52
发表于 2018-4-24 21:27:19 | 显示全部楼层 |阅读模式
DECLARE @s date SET @s = '2018-3-1'--开始日期
DECLARE @e date SET @e = '2018-3-2'--结束日期
;with PTMD  as ---查那天把日期改那天
(SELECT convert(float,COUNT(WAYBILL_NO)) as a FROM [ytodb].
[dbo].[T_EXP_WAYBILL_CHECK] where  CREATE_TIME between @s and @e and OP_CODE='310'and AUX_OP_CODE<>'delete'
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 between @s and @e and OP_CODE='310'and AUX_OP_CODE<>'delete'),  dz  as (SELECT convert(float,COUNT(WAYBILL_NO)) as c
FROM [ytodb].[dbo].[T_EXP_WAYBILL_CHECK] where CREATE_TIME between @s and @e and OP_CODE='310'
and AUX_OP_CODE<>'delete' and (WAYBILL_NO like '8%'or WAYBILL_NO like '60000%'))SELECT b.b AS 总票数,c.c AS 电子票数 ,a.a AS 普单票数,left(c.c/b.b*100,4)+'%' AS 电子占比,left(100.00-left(c.c/b.b*100,4),4)+'%' AS 普通占比 FROM PTMD a,zs b,dz c

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2018-5-21 01:28 , Processed in 0.062500 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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