1、有空值的数据相加.在SQL SERVER2000 中用ISNULL(字段1,0) 可以解决,在Access中如何解决
2、有Union 在Access中的操作,它会出现一样的两条。哪位大哥帮我改改Select A.KMBM,A.FKM,A.XH+A.KMMC as KMMC,A.KMDW,(Select isnull(Sum(B.SRXTSR),0)+isnull(sum(B.SRJK),0)+isnull(sum(SRJFBK),0) as SR From T_SZMXZ B Where B.KMBM like A.KMBM+'%' And B.XMBH =:XMBH1 And (B.RQ >=:RQ1 And B.RQ <= :RQ2)) as SR,null as ZC,null as YSKS,null as ZJYE From T_KJKMFL A Where A.KMBM >='01' And A.KMBM <'02'
union Select A.KMBM,A.FKM,A.XH+A.KMMC as KMMC,A.KMDW,(Select isnull(Sum(B.SRXTSR),0)+isnull(sum(B.SRJK),0)+isnull(sum(SRJFBK),0) as SR From T_SZMXZ B Where B.XMBH =:XMBH2 And (B.RQ >=:RQ3 And B.RQ <= :RQ4)) as SR,(Select Sum(C.ZCZC) as ZC From T_SZMXZ C Where C.XMBH =:XMBH3 And (C.RQ >=:RQ5 And C.RQ <= :RQ6)) as ZC,(Select sum(D.ZCYSKS) as YSZK From T_SZMXZ D Where D.XMBH =:XMBH4 And (D.RQ >=:RQ7 And D.RQ <= :RQ8)) as YSKS,(Select (isnull(Sum(E.SRXTSR),0)+isnull(sum(E.SRJK),0)+isnull(sum(E.SRJFBK),0))-(isnull(Sum(E.ZCZC), 0)+isnull(sum(E.ZCYSKS),0)) as ZJYE From T_SZMXZ E Where E.XMBH =:XMBH5 And (E.RQ >=:RQ9 And E.RQ <= :RQ10)) as ZJYE From T_KJKMFL A Where A.KMBM ='02'
2、有Union 在Access中的操作,它会出现一样的两条。哪位大哥帮我改改Select A.KMBM,A.FKM,A.XH+A.KMMC as KMMC,A.KMDW,(Select isnull(Sum(B.SRXTSR),0)+isnull(sum(B.SRJK),0)+isnull(sum(SRJFBK),0) as SR From T_SZMXZ B Where B.KMBM like A.KMBM+'%' And B.XMBH =:XMBH1 And (B.RQ >=:RQ1 And B.RQ <= :RQ2)) as SR,null as ZC,null as YSKS,null as ZJYE From T_KJKMFL A Where A.KMBM >='01' And A.KMBM <'02'
union Select A.KMBM,A.FKM,A.XH+A.KMMC as KMMC,A.KMDW,(Select isnull(Sum(B.SRXTSR),0)+isnull(sum(B.SRJK),0)+isnull(sum(SRJFBK),0) as SR From T_SZMXZ B Where B.XMBH =:XMBH2 And (B.RQ >=:RQ3 And B.RQ <= :RQ4)) as SR,(Select Sum(C.ZCZC) as ZC From T_SZMXZ C Where C.XMBH =:XMBH3 And (C.RQ >=:RQ5 And C.RQ <= :RQ6)) as ZC,(Select sum(D.ZCYSKS) as YSZK From T_SZMXZ D Where D.XMBH =:XMBH4 And (D.RQ >=:RQ7 And D.RQ <= :RQ8)) as YSKS,(Select (isnull(Sum(E.SRXTSR),0)+isnull(sum(E.SRJK),0)+isnull(sum(E.SRJFBK),0))-(isnull(Sum(E.ZCZC), 0)+isnull(sum(E.ZCYSKS),0)) as ZJYE From T_SZMXZ E Where E.XMBH =:XMBH5 And (E.RQ >=:RQ9 And E.RQ <= :RQ10)) as ZJYE From T_KJKMFL A Where A.KMBM ='02'
解决方案 »
- sql server2000如何将数据分成两半SELECT出来
- 无法修改存储过程名
- 求一个求和的sql
- EXEC sp_configure N'min server memory (MB)'为什么还有个N呢?
- 开发经验和技巧共享
- 存储过程中的问题
- 第二次备份时出错?
- 奇怪的错误.在NEW table or design table or open table 时
- 如何加快读取Excel数据到SQL Server上来!有源码分析.
- insert语句与foreign key samr table约束冲突
- 请问如何使用sql语句创建一个backup device
- SQL SERVER有什么方法将两个数据的表结构合并一起
在ACCESS中:用NZ(字段1,0)
在ADO中:iif(isnull(字段1),0,字段1)
2、有Union 在Access中的操作,它会出现一样的两条。
没有遇到过此问题,你应该发到ACCESS版