老师指点一下,实在查不出哪里问题?DateVisit是日期型列
Dim d As Date = Date.Today
dim Val06 as integer
f = "[DateVisit] >= '" & d & "' and [DateVisit] < '" &
d.AddDays(1) & "' and [Possessor] = '" & P & "'"
加载表统计行数OK
Val06 = DataTables("UserVisit").SQLCompute("Count(*)", f)
以下统计行数,不加载表,出错:列名 'DateVisit' 无效。
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "Select
Count(*) Fr om {UserVisit} Where " &
fVal06 = cmd.ExecuteScalar()
我又作了判断,还是同样的问题,出错:列名 'DateVisit' 无效。
dim Val as integer
val = cmd.ExecuteScalar()
If val.ToString <> Nothing Then ’这个是否一定要作判断
Val06 = val
End If