1234567891011121314 |
- use UFDATA_002_2019
- go
- if exists(select *From sysobjects where id= object_id('dbo.view_counts'))
- drop view dbo.view_counts
- go
- create view view_counts
- as
- select tm.单据类型,'2019-10-01 00:00:00' as 开始时间,tm.截止时间, t.下载总数 from (select count(1) as 下载总数 from wtu..DispatchList where bReturnFlag=0) t,(select entitytype as 单据类型,Convert(nvarchar(100),lasttime,20) as 截止时间 from wtu..transtime where entitytype='销售出库') tm
- union
- select tm.单据类型,'2019-10-01 00:00:00' as 开始时间,tm.截止时间, t.下载总数 from (select count(1) as 下载总数 from UFDATA_002_2019.. DispatchList where bReturnFlag=1) t,(select '销售退货' as 单据类型,Convert(nvarchar(100),lasttime,20) as 截止时间 from wtu..transtime where entitytype='销售订单') tm
- union
- select tm.单据类型,'2019-10-01 00:00:00' as 开始时间,tm.截止时间, t.下载总数 from (select count(1) as 下载总数 from UFDATA_002_2019.. RdRecord01 where cDefine1='来源旺店通') t,(select '采购入库' as 单据类型,Convert(nvarchar(100),lasttime,20) as 截止时间 from wtu..transtime where entitytype='采购入库') tm
- go
|