读书人

sql转access的有关问题

发布时间: 2012-01-24 23:11:54 作者: rapoo

sql转access的问题
已经开了很多帖子了,试验过无数遍,发现在sql里面没问题可是换成access数据库问题就多多了
string myselect = " select account.*,hte-glf +(case when (select Sum(sr-zc) from [type] where [type].bianhao=account.bianhao) is null then 0 else (select Sum(sr-zc) from [type] where [type].id=account.bianhao) end) as 余额from [account] ";
不知道有没有解决的办法了,已经用了[]可是还是提示IErrorInfo.GetDescription 因 E_FAIL(0x80004005) 而失败。


[解决办法]
lz的查询语句看着就觉得很有问题,把你的access数据库和要的结果发到我邮箱wzq6511@163.com我看看
[解决办法]
select account.* , hte-glf+ iif( (select sum(sr-zc) from [type] where [type].bianhao=account.bianhao) is null ,0,(select sum(sr-zc) from [type] where [type].bianhao=account.bianhao)) as ye from account

可以


isnull用的有,MS SQL和ACCESS是有不少。

PS:主的太多,一是“accout”,一是“account”。

前面的件是“[type].bianhao=account.bianhao”,後面又是“[type].id=account.bianhao”。

读书人网 >C#

热点推荐