SQL语句在ACCESS可以,在SQL2000不知道怎么改才能运行?(100分)

W

www.www

Unregistered / Unconfirmed
GUEST, unregistred user!
s:=s+'select D.日期,iif((select sum(合计数量) from xiaoshourecord S where (S.日期 = D.日期) and (S.日期 between '''+s1+''' and '''+s2+'''))is null,0,(select sum(合计数量) from xiaoshourecord S where (S.日期 = D.日期) and (S.日期 between '''+s1+''' and '''+s2+'''))) &nbsp; as 销售合计数量 ';<br><br>s:=s+'from (select distinct 日期 from (select 日期 from xiaoshourecord where (日期 between '''+s1+''' and '''+s2+''') union all &nbsp;select 日期 from xiaoshouTHrecord where (日期 between '''+s1+''' and '''+s2+'''))) D';<br><br>以上在ACCESS可以,在SQL2000不知道怎么改才能运行?
 
SQL Server2000也有iif()函数,看你的SQL语句应该不用做什么改动。你提取SQL语句到查询分析器中跑一下不就知道了?
 
试过不行才来请教的.<br>把IIS改为ISNULL也试了,还出错,不知道还要改哪个地方?
 
那你应该把你提取到的SQL语句贴出来,而不是你的Delphi语句。另外也应当把报错信息贴出来。
 
iif改为case<br>case语句用法:<br>case 变量 when 值1 then 值a [when 值2 then 值b]... [else 值z] end<br>case when 条件1 then 值a [when 条件2 then 值b]... [else 值z] end
 
还是没有调试成功,有哪位懂的朋友请告诉一下
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
891
import
I
I
回复
0
查看
628
import
I
顶部