For i = 1 To 12
.Open "select sum(fy) as Sfy from tbluseinfo where year(intime) = " & NYear & " and month(intime) =" & i
McrNdsy.Row = i
If .EOF Then
McrNdsy.Data = 0
Else
McrNdsy.Data = .Fields(0) '???????
End If
.Close
Next运行时程序提示无效的NULL值,可是数据库里面明明是有数据的,不知道是不是语法错误,请知道的朋友帮我看一下!
.Open "select sum(fy) as Sfy from tbluseinfo where year(intime) = " & NYear & " and month(intime) =" & i
McrNdsy.Row = i
If .EOF Then
McrNdsy.Data = 0
Else
McrNdsy.Data = .Fields(0) '???????
End If
.Close
Next运行时程序提示无效的NULL值,可是数据库里面明明是有数据的,不知道是不是语法错误,请知道的朋友帮我看一下!
解决方案 »
- 如何将ASP代码用VB转成DLL组件?
- 最快删除文本中重复行数的算法
- 这段代码正确吗?
- 有没有类似combo的输入控件,但combo有几千项,并切要求能通过字头,拼音头,编码进行过滤。
- 在情报局看到一条招聘信息
- RichTextBox如何保存内容为TXT文件?
- 如何用vb代码把access数据库中数据表里不符合要求的记录删除
- 如何判断文件已经打开
- 远程侦测的问题
- 一道智力题!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- inet控件如何删除服务器上的文件??
- ★=★=★=★求 WAV格式 的高手来帮我解决一下a-law、mu-law、PCM的转换问题
if .state=adsatteopen then .close
.Open "select sum(fy) as Sfy from tbluseinfo where year(intime) = " & NYear & " and month(intime) =" & i
McrNdsy.Row = i
If .EOF Then
McrNdsy.Data = 0
Else
McrNdsy.Data = .Fields(0) & ""
End If
.Close
Next
select year(intime),month(intime),sum(fy) as Sfy from tbluseinfo group by year(intime),month(intime)
conn.excuit strselect, i(循环用I此处可能要再定义一个integer)或直接用3,1sql语句语法应该没太大问题吧
.Open "select sum(fy) as Sfy from tbluseinfo where year(intime) = " & NYear & " and month(intime) =" & i
McrNdsy.Row = i
If .EOF Then
McrNdsy.Data = 0
Else
McrNdsy.Data =iif( .Fields(0)<>"",.fields(0),"") '???????
End If
.Close
Next
是不是这个原因!
For i = 1 To 12
.Open "select sum(fy) as Sfy from tbluseinfo where year(intime) = " & NYear & " and month(intime) =" & i
McrNdsy.Row = i
McrNdsy.Data = iif(isnull(.Fields(0)),0,.Fields(0))
.Close
Next
数据库里面有值存在的话,则说明你的SQL语句本身有问题,因为没有看到实际的数据库,成以没有办法帮你了。