版主你好,请看下面的SQL语句,当插入值为空时SQL出错
版主你好,请看下面的SQL语句。Set rs = conn.Execute("SELECT sum(期末金额), sum(本期金额),sum(期初金额),sum(本期耗金额) FROM cbe0")
sq = "insert into cbe0 (名称,期末金额,本期金额,期初金额,本期耗金额) values('合 计'," & rs.Fields(0) & "," & rs.Fields(1) & "," & rs.Fields(2) & "," & rs.Fields(3) & ")"
conn.Execute sq
这条SQL语句并没有错,但sum(期末金额), sum(本期金额),sum(期初金额),sum(本期耗金额)4项中任意一项为NILL时,程序出错,请问这种SQL语句该如何写。