海信商海导航数据库常用操作_第1页
海信商海导航数据库常用操作_第2页
海信商海导航数据库常用操作_第3页
海信商海导航数据库常用操作_第4页
海信商海导航数据库常用操作_第5页
已阅读5页,还剩11页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、在查询分析器中输入1把质疑的数据库更改为紧急模式sp_configure 'allow',1go-reconfigure with overridego-update master.sysdatabasesset status = 32768where name = 'zb'2不能修改进价解决方案if Not Exists(select * from XtFunction where FunCode in ('OP09') begin insert into XtRightFunc(UGrpCode,FunCode,IsInsert,IsUpda

2、te,IsDelete,IsQuery,IsPrint,IsConvert) select UGrpCode,'OP09','0','0','0','0','0','0' from xtUserGrp x where UGrpCode not in ('01','02') and not exists(select 1 from XtRightFunc where UGrpCode=x.UGrpCode and FunCode='OP09

3、9; ) if not exists(select 1 from XtFunction where FunCode='OP09') insert into XtFunction(FunCode,FunName,FunType,DllName,DllFun,DllType,FormType,VER,SerialNo,IsMenu,Remark,IsInsert,IsUpdate,IsDelete,IsQuery,IsPrint,IsConvert,OrderNo,IsChart,ChartSerialNo,ChartFunType,ChartOrderNo,ChartViewPo

4、sition,ChartParentFunCode) values('OP09','采购和验收允许修改进价','1','','','0','1','0','0070','0','','0','0','0','0','0','0',10,'2','0900','1',1,'

5、','OP')endGo3部类商品与普通商品的转换命令update goods set plutype='2' where plucode='商品编码'备注:输入2是把普通商品转换为部类商品 输入0是把部类商品转换为普通商品4海信ftp中心ftp:/navigator:hisensoft81 ftp:/navigator:hisensoft0 ftp:/navigator:hisensoft465海信普通商品改部类商品update goods set plutype=&

6、#39;2' where plucode='商品编码 '另外要把修改商品的供应商经联销性质更改2是部门商品0是普通商品6海信数据库重见表索引DECLARE DBCCString NVARCHAR(1000)DECLARE TableName VARCHAR(100)DECLARE Cur_Index CURSORFOR SELECT Name AS TblName FROM sysobjects WHERE xType='U' ORDER BY TblNameFOR READ ONLYOPEN Cur_IndexFETCH NEXT FROM Cur_I

7、ndexINTO TableNameWHILE FETCH_STATUS=0BEGIN SET DBCCString = 'DBCC DBREINDEX(TblName,'''')WITH NO_INFOMSGS' EXEC SP_EXECUTESQL DBCCString, N'TblName VARCHAR(100)', TableName PRINT '重建表' + TableName +'的索引.OK!' FETCH NEXT FROM Cur_Index INTO TableNameEND

8、CLOSE Cur_IndexDEALLOCATE Cur_IndexPRINT '操作完成!'7解决部门商品更改为普通商品时库存管理没有启用的问题update goods set mngstock='1'1 where plucode='商品编码8品类进销存GeneralRptName=品类进销存RptComment=按照日期查询某时间内品类进销存汇总ParametersCount=4ParametersParameter1=BgnDate;起始日期:;3;0;Parameter2=EndDate;截止日期:;3;0;Parameter3=FClsCo

9、de;品类:;5;0;Parameter4=orgcode;门店:;6;0;Columns上期库存|数量=上期库存|数量;0.000;R;2上期库存|含税进价金额=上期库存|含税进价金额;0.00;R;2上期库存|无税进价金额=上期库存|无税进价金额;0.00;R;2上期库存|售价金额=上期库存|售价金额;0.00;R;2进货|数量=进货|数量;0.000;R;2进货|含税进价金额=进货|含税进价金额;0.00;R;2进货|无税进价金额=进货|无税进价金额;0.00;R;2进货|售价金额=进货|售价金额;0.00;R;2退货|数量=退货|数量;0.000;R;2退货|含税进价金额=退货|含税进

10、价金额;0.00;R;2退货|无税进价金额=退货|无税进价金额;0.00;R;2退货|售价金额=退货|售价金额;0.00;R;2调入|数量=调入|数量;0.000;R;2调入|含税进价金额=调入|含税进价金额;0.00;R;2调入|无税进价金额=调入|无税进价金额;0.00;R;2调入|售价金额=调入|售价金额;0.00;R;2调出|数量=调出|数量;0.000;R;2调出|含税进价金额=调出|含税进价金额;0.00;R;2调出|无税进价金额=调出|无税进价金额;0.00;R;2调出|售价金额=调出|售价金额;0.00;R;2配送|数量=配送|数量;0.000;R;2配送|含税进价金额=配送|

11、含税进价金额;0.00;R;2配送|无税进价金额=配送|无税进价金额;0.00;R;2配送|售价金额=配送|售价金额;0.00;R;2配送退货|数量=配送退货|数量;0.000;R;2配送退货|含税进价金额=配送退货|含税进价金额;0.00;R;2配送退货|无税进价金额=配送退货|无税进价金额;0.00;R;2配送退货|售价金额=配送退货|售价金额;0.00;R;2领用|数量=领用|数量;0.000;R;2领用|含税进价金额=领用|含税进价金额;0.00;R;2领用|无税进价金额=领用|无税进价金额;0.00;R;2领用|售价金额=领用|售价金额;0.00;R;2盘盈|数量=盘盈|数量;0.0

12、00;R;2盘盈|含税进价金额=盘盈|含税进价金额;0.00;R;2盘盈|无税进价金额=盘盈|无税进价金额;0.00;R;2盘盈|售价金额=盘盈|售价金额;0.00;R;2盘亏|数量=盘亏|数量;0.000;R;2盘亏|含税进价金额=盘亏|含税进价金额;0.00;R;2盘亏|无税进价金额=盘亏|无税进价金额;0.00;R;2盘亏|售价金额=盘亏|售价金额;0.00;R;2残损削价|数量=残损削价|数量;0.000;R;2残损削价|含税进价金额=残损削价|含税进价金额;0.00;R;2残损削价|无税进价金额=残损削价|无税进价金额;0.00;R;2残损削价|售价金额=残损削价|售价金额;0.00

13、;R;2变价增值|含税进价金额=变价增值|含税进价金额;0.00;R;2变价增值|无税进价金额=变价增值|无税进价金额;0.00;R;2变价减值|含税进价金额=变价减值|含税进价金额;0.00;R;2变价减值|无税进价金额=变价减值|无税进价金额;0.00;R;2销售|数量=销售|数量;0.000;R;2销售|含税销售成本=销售|含税销售成本;0.00;R;2销售|无税销售成本=销售|无税销售成本;0.00;R;2销售|售价金额=销售|售价金额;0.00;R;2批发|数量=批发|数量;0.000;R;2批发|含税成本=批发|含税成本;0.00;R;2批发|无税成本=批发|无税成本;0.00;R

14、;2批发|售价金额=批发|售价金额;0.00;R;2本期库存|数量=本期库存|数量;0.000;R;2本期库存|含税进价金额=本期库存|含税进价金额;0.00;R;2本期库存|无税进价金额=本期库存|无税进价金额;0.00;R;2本期库存|售价金额=本期库存|售价金额;0.00;R;2Content/*按照日期查询某时间内品类进销存报表使用说明:本结果取自gbk商品台账及goods商品信息表中的品类编码Created by 秦树琦 2008-03-12*/ Declare BgnDate char(10) Declare EndDate char(10) Declare OrgCode cha

15、r(10) Declare ClsCode char(10) Declare ClsLevel char(1) -品类总级别 Declare SelectClsLevel char(1) -当前选定的品类级别 Declare sTmpDate Varchar(10) -临时日期 Declare sSql Varchar(8000) select BgnDate=:BgnDate select EndDate=:EndDate select OrgCode=:orgcode select ClsCode=:FClsCode/*查询品类级别和当前选择的品类级别,以便计算出汇总其下一级品类的进销存*

16、/ select ClsLevel=ItemValue From SysCfg where Section = 'SYSTEM' and ItemName = 'CLSLEVEL' if ClsCode = '000000' set SelectClsLevel='0' else select SelectClsLevel=ClsLevel from GClass where ClsCode = ClsCode /*删除旧的视图V_GBK*/ if exists (select * from dbo.sysobjects wher

17、e id = object_id(N'dbo.V_GBK') and OBJECTPROPERTY(id, N'IsView') = 1) drop view dbo.V_GBK SET QUOTED_IDENTIFIER ON SET ANSI_NULLS ON /*设置基本语句指定时间gbk汇总到视图V_GBK*/ set sTmpDate=BgnDate while not Exists(Select Name from sysobjects where name='GBK'+SubString(sTmpDate,1,4)+SubStrin

18、g(sTmpDate,6,2) and XType='U') begin Set sTmpDate=Convert(char(10),DateAdd(Month,1,sTmpDate),120) end Set sSQL='CREATE VIEW dbo.V_GBK AS SELECT * FROM GBK'+SubString(sTmpDate,1,4)+SubString(sTmpDate,6,2)Set sTmpDate=Convert(char(10),DateAdd(Month,1,sTmpDate),120) While (SubString(sTm

19、pDate,1,4)+SubString(sTmpDate,6,2)<=(SubString(EndDate,1,4)+SubString(EndDate,6,2)/*设置Union语句*/BeginIf Exists(Select Name from sysobjects where name='GBK'+SubString(sTmpDate,1,4)+SubString(sTmpDate,6,2) and XType='U') Begin-Union Set sSQL=sSQL+' union allSELECT * FROM GBK'

20、+SubString(sTmpDate,1,4)+SubString(sTmpDate,6,2) End Set sTmpDate=Convert(char(10),DateAdd(Month,1,sTmpDate),120)End/*执行命令,更新视图语句*/Exec(sSql)-SET QUOTED_IDENTIFIER OFF -SET ANSI_NULLS OFF - select * from V_GBK=/*创建临时表#TmpGBk*/if exists (select * from tempdb.sysobjects where id = object_id(N'#Tmp

21、GBk') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table #TmpGBkCreate table #TmpGBk(AccDate char (10) NOT NULL, OrgCode char (6) NOT NULL Default (''), PluCode char (20) NOT NULL, DepCode char (6) NOT NULL, SqCost money NOT NULL DEFAULT (0), SqNetCost money NOT NULL DEFAULT

22、(0), SqTotal money NOT NULL DEFAULT (0), SqCount money NOT NULL DEFAULT (0), JhCost money NOT NULL DEFAULT (0), JhNetCost money NOT NULL DEFAULT (0), JhTotal money NOT NULL DEFAULT (0), JhCount money NOT NULL DEFAULT (0), ThCost money NOT NULL DEFAULT (0), ThNetCost money NOT NULL DEFAULT (0), ThTot

23、al money NOT NULL DEFAULT (0), ThCount money NOT NULL DEFAULT (0), DrCost money NOT NULL DEFAULT (0), DrNetCost money NOT NULL DEFAULT (0), DrTotal money NOT NULL DEFAULT (0), DrCount money NOT NULL DEFAULT (0), DcCost money NOT NULL DEFAULT (0), DcNetCost money NOT NULL DEFAULT (0), DcTotal money N

24、ULL DEFAULT (0), DcCount money NULL DEFAULT (0), ZpCost money NOT NULL DEFAULT (0), ZpNetCost money NOT NULL DEFAULT (0), ZpTotal money NOT NULL DEFAULT (0), ZpAmount money NOT NULL DEFAULT (0), ZpCount money NOT NULL DEFAULT (0), ZtCost money NOT NULL DEFAULT (0), ZtNetCost money NOT NULL DEFAULT (

25、0), ZtTotal money NOT NULL DEFAULT (0), ZtAmount money NOT NULL DEFAULT (0), ZtCount money NOT NULL DEFAULT (0), LyCost money NOT NULL DEFAULT (0), LyNetCost money NOT NULL DEFAULT (0), LyTotal money NOT NULL DEFAULT (0), LyCount money NOT NULL DEFAULT (0), PyCost money NOT NULL DEFAULT (0), PyNetCo

26、st money NOT NULL DEFAULT (0), PyTotal money NOT NULL DEFAULT (0), PyCount money NOT NULL DEFAULT (0), PkCost money NOT NULL DEFAULT (0), PkNetCost money NOT NULL DEFAULT (0), PkTotal money NOT NULL DEFAULT (0), PkCount money NOT NULL DEFAULT (0), XjCost money NOT NULL DEFAULT (0), XjNetCost money N

27、OT NULL DEFAULT (0), XjTotal money NOT NULL DEFAULT (0), XjCount money NOT NULL DEFAULT (0), TkCost money NOT NULL DEFAULT (0), TkNetCost money NOT NULL DEFAULT (0), TjCost money NOT NULL DEFAULT (0), TjNetCost money NOT NULL DEFAULT (0), TkTotal money NOT NULL DEFAULT (0), TjTotal money NOT NULL DE

28、FAULT (0), XsCost money NOT NULL DEFAULT (0), XsNetCost money NOT NULL DEFAULT (0), XsTotal money NOT NULL DEFAULT (0), XsAmount money NOT NULL DEFAULT (0), XsCount money NOT NULL DEFAULT (0), DscTotal money NOT NULL DEFAULT (0), PfSaleCount money NOT NULL DEFAULT (0), PfSaleCost money NOT NULL DEFA

29、ULT (0), PfSaleNetCost money NOT NULL DEFAULT (0), PfSaleTotal money NOT NULL DEFAULT (0), PfSaleAmount money NOT NULL DEFAULT (0), PfReturnCount money NOT NULL DEFAULT (0), PfReturnCost money NOT NULL DEFAULT (0), PfReturnNetCost money NOT NULL DEFAULT (0), PfReturnTotal money NOT NULL DEFAULT (0),

30、 PfReturnAmount money NOT NULL DEFAULT (0), BqCost money NOT NULL DEFAULT (0), BqNetCost money NOT NULL DEFAULT (0), BqTotal money NOT NULL DEFAULT (0), BqCount money NOT NULL DEFAULT (0), CONSTRAINT PK_#TmpGBk PRIMARY KEY (AccDate,OrgCode,PluCode,DepCode) )-插入编码、部门、组织 Insert into #TmpGBk (AccDate,P

31、luCode,DepCode,OrgCode) select Distinct'',PluCode,DepCode,OrgCode from V_GBK A Where AccDate <= EndDate or FormType='Z' -更新上期结存数=上期结存数Update A Set A.SqCount=G.JcCount,A.SqCost=G.JcCost,A.SqNetCost=G.JcNetCost,A.SqTotal=G.JcTotal from #TmpGBk A,V_GBK G where A.PluCode=G.PluCode and

32、 A.DepCode=G.DepCode and A.OrgCode=G.OrgCode and G.FormType='Z' and month(g.accdate)=month(bgndate) and year(g.accDate)=year(BgnDate) -用发生数更新上期结存数Update G Set G.SqCount=G.SqCount+B.FsCount,G.SqCost=G.SqCost+B.FsCost,G.SqNetCost=G.SqNetCost+B.FsNetCost,G.SqTotal=G.SqTotal+B.FsTotal from #TmpG

33、Bk G, (select PluCode,DepCode,OrgCode, Sum(Case When FormType in('3','5','6','7','A','E','F','G') then -fsCount When FormType in ('4','8') then 0 Else FsCount End) as FsCount, Sum(Case When FormType in('3','5

34、','6','7','A','E','F','G') then -fsCost Else FsCost End) as FsCost, Sum(Case When FormType in('3','5','6','7','A','E','F','G') then -fsNetCost Else fsNetCost End) as fsNetCost, Sum(Cas

35、e When FormType in('3','5','6','7','A','E','F','G') then -fsTotal Else fsTotal End) as fsTotal from V_GBK A where AccDate< BgnDate group by a.plucode,a.depcode,code ) B WHERE G.PluCode=B.PluCode and G.DepCode=B.DepCode and G.Org

36、Code=B.OrgCode -goInsert into #TmpGBk(AccDate,PluCode,DepCode,OrgCode) select Distinct '',PluCode,DepCode,OrgCode from V_GBK A Where AccDate Between BgnDate and EndDate and PluCode+'-'+DepCode+'-'+OrgCode Not in (select PluCode+'-'+DepCode+'-'+OrgCode from #Tm

37、pGBk) -更新发生数Update G Set G.JhCount=G.JhCount+B.JhCount,G.JhCost=G.JhCost+B.JhCost,G.JhNetCost=G.JhNetCost+B.JhNetCost,G.JhTotal=G.JhTotal+B.JhTotal, G.ThCount=G.ThCount+B.ThCount,G.ThCost=G.ThCost+B.ThCost,G.ThNetCost=G.ThNetCost+B.ThNetCost,G.ThTotal=G.ThTotal+B.ThTotal, G.DrCount=G.DrCount+B.DrCou

38、nt,G.DrCost=G.DrCost+B.DrCost,G.DrNetCost=G.DrNetCost+B.DrNetCost,G.DrTotal=G.DrTotal+B.DrTotal, G.DcCount=G.DcCount+B.DcCount,G.DcCost=G.DcCost+B.DcCost,G.DcNetCost=G.DcNetCost+B.DcNetCost,G.DcTotal=G.DcTotal+B.DcTotal, G.ZpCount=G.ZpCount+B.ZpCount,G.ZpCost=G.ZpCost+B.ZpCost,G.ZpNetCost=G.ZpNetCos

39、t+B.ZpNetCost,G.ZpTotal=G.ZpTotal+B.ZpTotal, G.ZtCount=G.ZtCount+B.ZtCount,G.ZtCost=G.ZtCost+B.ZtCost,G.ZtNetCost=G.ZtNetCost+B.ZtNetCost,G.ZtTotal=G.ZtTotal+B.ZtTotal, G.LyCount=G.LyCount+B.LyCount,G.LyCost=G.LyCost+B.LyCost,G.LyNetCost=G.LyNetCost+B.LyNetCost,G.LyTotal=G.LyTotal+B.LyTotal, G.PyCou

40、nt=G.PyCount+B.PyCount,G.PyCost=G.PyCost+B.PyCost,G.PyNetCost=G.PyNetCost+B.PyNetCost,G.PyTotal=G.PyTotal+B.PyTotal, G.PkCount=G.PkCount+B.PkCount,G.PkCost=G.PkCost+B.PkCost,G.PkNetCost=G.PkNetCost+B.PkNetCost,G.PkTotal=G.PkTotal+B.PkTotal, G.XjCount=G.XjCount+B.XjCount,G.XjCost=G.XjCost+B.XjCost,G.

41、XjNetCost=G.XjNetCost+B.XjNetCost,G.XjTotal=G.XjTotal+B.XjTotal, G.TkCost=G.TkCost+B.TkCost,G.TkNetCost=G.TkNetCost+B.TkNetCost,G.TkTotal=G.TkTotal+B.TkTotal, G.TjCost=G.TjCost+B.TjCost,G.TjNetCost=G.TjNetCost+B.TjNetCost,G.TjTotal=G.TjTotal+B.TjTotal, G.XsCount=G.XsCount+B.XsCount,G.XsCost=G.XsCost

42、+B.XsCost,G.XsNetCost=G.XsNetCost+B.XsNetCost,G.XsTotal=G.XsTotal+B.XsTotal, G.PfSaleCount=G.PfSaleCount+B.PfSaleCount,G.PfSaleCost=G.PfSaleCost+B.PfSaleCost,G.PfSaleNetCost=G.PfSaleNetCost+B.PfSaleNetCost,G.PfSaleTotal=G.PfSaleTotal+B.PfSaleTotal, G.PfReturnCount=G.PfReturnCount+B.PfReturnCount,G.P

43、fReturnCost=G.PfReturnCost+B.PfReturnCost,G.PfReturnNetCost=G.PfReturnNetCost+B.PfReturnNetCost,G.PfReturnTotal=G.PfReturnTotal+B.PfReturnTotal from #TmpGBk G, (select PluCode,DepCode,OrgCode, Sum(Case FormType when '0' then FsCount else 0 end ) JhCount, Sum(Case when (FormType='1')

44、and (FsCount>0) or (FormType='D') then FsCount when (FormType='F') or (FormType='G') and (FsCount<0) then FsCount*(-1) else 0 end ) DrCount, Sum(Case when (FormType='1') and (FsCount<0) or (FormType='C') then FsCount*(-1) when (FormType='F') o

45、r (FormType='G') and (FsCount>0) then FsCount else 0 end ) DcCount, Sum(Case when (FormType='2') or (FormType='9') and (FsCount>0) then FsCount else 0 end ) PyCount,Sum(Case when (FormType='2') or (FormType='9') and (FsCount<0) then FsCount*(-1) else

46、0 end ) PkCount, Sum(Case FormType when '3' then FsCount else 0 end ) XjCount, Sum(Case FormType when '5' then FsCount else 0 end ) ThCount, Sum(Case FormType when '6' then FsCount else 0 end ) XsCount, Sum(Case FormType when '7' then FsCount else 0 end ) LyCount, Sum

47、(Case FormType when 'A' then FsCount else 0 end ) PfSaleCount, Sum(Case FormType when 'B' then FsCount else 0 end ) PfReturnCount, Sum(Case when (FormType='E') and (FsCount>0) then FsCount else 0 end ) ZpCount, Sum(Case when (FormType='E') and (FsCount<0) then F

48、sCount*(-1) else 0 end ) ZtCount, Sum(Case FormType when '0' then FsCost else 0 end ) JhCost, Sum(Case when (FormType='1') and (FsCount>0) or (FormType='D') then FsCost when (FormType='F') or (FormType='G') and (FsCount<0) then FsCost*(-1) else 0 end ) D

49、rCost, Sum(Case when (FormType='1') and (FsCount<0) or (FormType='C') then FsCost*(-1) when (FormType='F') or (FormType='G') and (FsCount>0) then FsCost else 0 end ) DcCost, Sum(Case when (FormType='2') or (FormType='9') and (FsCost>0) then Fs

50、Cost else 0 end ) PyCost,Sum(Case when (FormType='2') or (FormType='9') and (FsCost<0) then FsCost*(-1) else 0 end ) PkCost, Sum(Case FormType when '3' then FsCost else 0 end ) XjCost, Sum(Case when (FormType='4') and (FsCost)<0 then FsCost*(-1) else 0 end ) TkC

51、ost, Sum(Case when (FormType='4') and (FsCost)>0 then FsCost else 0 end ) TjCost, Sum(Case FormType when '5' then FsCost else 0 end ) ThCost, Sum(Case FormType when '6' then FsCost else 0 end ) XsCost, Sum(Case FormType when '7' then FsCost else 0 end ) LyCost, Sum

52、(Case FormType when 'A' then FsCost else 0 end ) PfSaleCost, Sum(Case FormType when 'B' then FsCost else 0 end ) PfReturnCost, Sum(Case when (FormType='E') and (FsCost>0) then FsCost else 0 end ) ZpCost, Sum(Case when (FormType='E') and (FsCost<0) then FsCost*(-

53、1) else 0 end ) ZtCost, Sum(Case FormType when '0' then FsNetCost else 0 end ) JhNetCost, Sum(Case when (FormType='1') and (FsCount>0) or (FormType='D') then FsNetCost when (FormType='F') or (FormType='G') and (FsCount<0) then FsNetCost*(-1) else 0 end )

54、 DrNetCost, Sum(Case when (FormType='1') and (FsCount<0) or (FormType='C') then FsNetCost*(-1) when (FormType='F') or (FormType='G') and (FsCount>0) then FsNetCost else 0 end ) DcNetCost, Sum(Case when (FormType='2') or (FormType='9') and (FsNetC

55、ost>0) then FsNetCost else 0 end ) PyNetCost,Sum(Case when (FormType='2') or (FormType='9') and (FsNetCost<0) then FsNetCost*(-1) else 0 end ) PkNetCost, Sum(Case FormType when '3' then FsNetCost else 0 end ) XjNetCost, Sum(Case when (FormType='4') and (FsNetCos

56、t)<0 then FsNetCost*(-1) else 0 end ) TkNetCost, Sum(Case when (FormType='4') and (FsNetCost)>0 then FsNetCost else 0 end ) TjNetCost, Sum(Case FormType when '5' then FsNetCost else 0 end ) ThNetCost, Sum(Case FormType when '6' then FsNetCost else 0 end ) XsNetCost, Sum

57、(Case FormType when '7' then FsNetCost else 0 end ) LyNetCost, Sum(Case FormType when 'A' then FsNetCost else 0 end ) PfSaleNetCost, Sum(Case FormType when 'B' then FsNetCost else 0 end ) PfReturnNetCost, Sum(Case when (FormType='E') and (FsNetCost>0) then FsNetCos

58、t else 0 end ) ZpNetCost, Sum(Case when (FormType='E') and (FsNetCost<0) then FsNetCost*(-1) else 0 end ) ZtNetCost, Sum(Case FormType when '0' then FsTotal else 0 end ) JhTotal, Sum(Case when (FormType='1') and (FsCount>0) or (FormType='D') then FsTotal when (F

59、ormType='F') or (FormType='G') and (FsCount<0) then FsTotal*(-1) else 0 end ) DrTotal, Sum(Case when (FormType='1') and (FsCount<0) or (FormType='C') then FsTotal*(-1) when (FormType='F') or (FormType='G') and (FsCount>0) then FsTotal else 0 e

60、nd ) DcTotal, Sum(Case when (FormType='2') or (FormType='9') and (FsTotal>0) then FsTotal else 0 end ) PyTotal,Sum(Case when (FormType='2') or (FormType='9') and (FsTotal<0) then FsTotal*(-1) else 0 end ) PkTotal, Sum(Case FormType when '3' then FsTotal

61、else 0 end ) XjTotal, Sum(Case FormType when '5' then FsTotal else 0 end ) ThTotal, Sum(Case FormType when '6' then FsTotal else 0 end ) XsTotal, Sum(Case FormType when '7' then FsTotal else 0 end ) LyTotal, Sum(Case when (FormType='8') and (FsTotal)<0 then FsTotal

62、*(-1) else 0 end ) TkTotal, Sum(Case when (FormType='8') and (FsTotal)>0 then FsTotal else 0 end ) TjTotal, Sum(Case FormType when 'A' then FsTotal else 0 end ) PfSaleTotal, Sum(Case FormType when 'B' then FsTotal else 0 end ) PfReturnTotal, Sum(Case when (FormType='E') and (FsTotal>0) then FsTotal else 0 end ) ZpTotal, Sum(Case wh

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论