发表于:2006-07-22 20:36:00
楼主
用OBDC做IFIX报表的问题:
'查询,根据报表修改
strQueryAvg = "Select DATETIME, VALUE, TAG FROM FIX " & _
"WHERE MODE = 'AVERAGE' and (TAG='" & Tag1 & "' or TAG='" & Tag2 & "'" & _
" or TAG='" & Tag3 & "' or TAG='" & Tag4 & "' or TAG='" & Tag5 & "'" & _
" or TAG='" & Tag6 & "' or TAG='" & Tag7 & "' or TAG='" & Tag8 & "')" & _
"and INTERVAL = '01:00:00' and " & _
"(DATETIME >= {ts '" & StartTime & "'} and " & _
"DATETIME <= {ts '" & EndTime & "'})"
用上面的代码做报表时,老报警,我试了一下,报警是因为日期格式造成的,里面的DATETIME不能在SQL中查询比较,查资料说和系统区域设置有关,可我设的一样呀,我试了一下,在IFIX里面用自已的控件调用历史数据,用到SQL查询DATETIME时也不行,怎么回事呢?