起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 146|回复: 7

【结帖】执行sql报错!**

[复制链接]
发表于 2007-12-14 16:36:30 | 显示全部楼层 |阅读模式
sql语句在sqlserver里执行正常,但调用DataSetBroker1.DataSet.Open;报错

1.jpg

14.63 KB, 下载次数: 99

回复

使用道具 举报

 楼主| 发表于 2007-12-14 16:37:05 | 显示全部楼层
sql语句如下:
select t.datetime as 时间,
round(t0.value,2) as DB1额定值烟流量,round(t1.value,2) as DB1实际值烟流量
from (select t.datetime,t.value from history t
where (wwRetrievalMode = 'Cyclic' and wwResolution = 5000 and opcquality=192)
and t.tagname in ('Z11DB1Value_1') and t.datetime >= '2007-11-26 08:30:00'
and t.datetime <= '2007-11-26 09:00:00') t0,(select t.datetime,t.value from history t
where (wwRetrievalMode = 'Cyclic' and wwResolution = 5000 and opcquality=192)
and t.tagname in ('Z11DB1Value_2') and t.datetime >= '2007-11-26 08:30:00'
and t.datetime <= '2007-11-26 09:00:00') t1,
(Select distinct t.datetime  
from openquery(InSQL,'select  t.datetime from history t  
where t.tagname in ("Z11DB1Value_1","Z11DB1Value_2")
and t.datetime >=''2007-11-26 08:30:00'' and t.datetime <=''2007-11-26 09:00:00''
and (wwRetrievalMode = "Cyclic" and wwResolution = 5000 and opcquality=192)') t) t
where  t.datetime = t0.datetime and t.datetime = t1.datetime
回复 支持 反对

使用道具 举报

发表于 2007-12-14 17:18:30 | 显示全部楼层
用tquery控件处理吧。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-12-14 17:24:53 | 显示全部楼层
为什么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-12-14 17:25:24 | 显示全部楼层
tquery不支持打印
回复 支持 反对

使用道具 举报

发表于 2007-12-14 17:28:28 | 显示全部楼层
那就用个视图,然后标准数据集连视图。
回复 支持 反对

使用道具 举报

发表于 2008-1-2 09:30:37 | 显示全部楼层
楼主请回馈
回复 支持 反对

使用道具 举报

发表于 2008-1-11 11:17:54 | 显示全部楼层
由于长时间没有反馈,先结帖了。
有问题请开新帖。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-5 02:24 , Processed in 0.047124 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表