空值如何处理
SQLStmt = "INSERT INTO zdrun (numbername,hm,score1,shijian) VALUES ('" + Trim(Text8) + "','" + Str(Trim(Text9)) + "'," & 1 & ",'" + Trim(Label37) + "')"SQLExt (SQLStmt)
DBDisconnect
SQLStmt = "select ifnull(sum(score1),0) ,ifnull(sum(score2),0), ifnull(sum(score3),0) from zdrun where ( hm = '" + Str(Trim(Text9)) + "')"
运行到上面一句,提示 ifnull 不是定义的函数,换成isnull提示参数数量不对,如何处理?想要的结果:如果sum统计的结果是空值,用0代替
Set rs = SQLQuery(SQLStmt)
Label17 = Text8 & "比赛得分:" & rs.Fields(0) + rs.Fields(1) + rs.Fields(2)
Label17.BackColor = vbBlack
Label17.Visible = False
Timer2.Enabled = True
Label4 = Label4 + 1
Text9 = ""
Text1.SetFocus
Text7 = ""
Exit Sub