注册 登录
编程论坛 ASP技术论坛

难道高手的简单问题

robinbest 发布于 2008-11-10 16:34, 863 次点击
这问题真奇怪了,越简单越难搞,究竟哪里有问题?
我把它简化到这样,还出错!
sql="SELECT sum(case when stype='PI' then qty else 0 end) as 入库量 FROM stock"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1

错误提示:
Microsoft OLE DB Provider for Visual FoxPro 错误 '80040e14'
Function name is missing ).
8 回复
#2
yms1232008-11-10 16:47
Function name is missing
这句话的意思是函数名不存在没用过FoxPro数据库不太清楚
#3
hokers2008-11-10 16:50
没具体的代码无法调试.
#4
robinbest2008-11-10 16:54
yms123 版主:
我的理解,这个和数据库没有关系吧,应该是提示语法错误!
sql="SELECT sum(qty) as 入库量 FROM stock"  这样就不出错!
#5
hokers2008-11-10 16:58
stype='PI'
啥类型.
#6
robinbest2008-11-10 17:03
stype 字符型
#7
sunfishy2008-11-10 17:11
你用的是mssql数据库吗?
#8
sunfishy2008-11-10 17:19
Visual FoxPro中好像是用iif函数吧..

mssql中用的是case when

你试下iif(条件,真值,假值)
#9
robinbest2008-11-10 17:23
8楼正解!
多谢了!
1