SQL语句在Sql server中没问题,在Access中有问题了,保证是标准的SQL语句!
表aaa
ID,price1,price2
表bbb
ID,price1,price2
表ccc
ID,price1
当ID相等时,把(aaa.price1-bbb.price1)+(bbb.price2-aaa.price1)写入ccc.price1
在SQL Server里面,用SQL查询器毫无问题. 但在access中,用ADOCommand.CommandText保存
以下查询语句,然后excute就出错!
update ccc set ccc.price1=(aaa.price1-bbb.price1)+(bbb.price2-aaa.price2)
from ccc, aaa, bbb
where aaa.id=bbb.id and bbb.id=ccc.id