求解!!ACCESS更新语句

来源:百度知道 编辑:UC知道 时间:2024/05/27 16:53:57
update [WxThreads] set score=case
when (select count(id) from WxThreads where forumid=19 and Username='"&CookieUserName&"' and logintime=Date() ) >=2 then 60 else 0 end

这句错在哪儿了?应该怎么改呢??
上面的不看了,
下面这条语句也错了吗。。。
高手赐教啊……

update [WxThreads] set AddUser= select count(id) from [WxThreads] where forumid=19 and username = 'qq@qq.com'

两句都确实错了
第一句 SQL查询中是没有When这个保留词的,子查询作条件不是用When来表达,而应该是Where xxx In (Select.....) 这种形式

第二句 子查询只能用为条件部分来使用,不能作为SET子句部分使用,把=后面的Select子句换成Dlookup()函数

update语句不能用when吧

(select count(id) from [WxThreads] where forumid=19 and username = 'qq@qq.com')要用括号括起来吧