在access中 select count(*) as 合计 from tablea where tablea.fielda=1 如果不存在的话
返回值不是0 而是空,什么都没有,有没有办法让select count(*) as 合计 from tablea where tablea.fielda=1 如果没有的话 count(*)返回的是0
返回值不是0 而是空,什么都没有,有没有办法让select count(*) as 合计 from tablea where tablea.fielda=1 如果没有的话 count(*)返回的是0
在sql2000中如果没有符合条件的记录,select count(*)返回的一定是0!
access 中应该也一样的!
你是不是搞错了?
query1.sql.text:='select count(*) as 合计 from tablea where tablea.fielda=1 '
query1.open;
if query1.isempty then
w:=0
这样就管他返回什么值,只要没有,w的值就为0
query1.sql.text:='select count(*) as 合计 from tablea where tablea.fielda=1 '
query1.open;
if query1.Fields[0].isNull then
w:=0