Sql server下: select isnull(字段1,0)- isnull(字段2,0) from 表1 where 时间 between '2008.8.8' and between '2009.8.8'
或 where 时间>'2008.8.8' 等
在access mdb里应该怎么写兼容语句呢?
不同的数据库支持不同的SQL语句、函数,要根据数据库更改SQL语句
select nz(字段1,0)- nz(字段2,0) from 表1 where 时间='2008.8.8'
or
select iif(isnull(字段1),0,字段1)- iif(isnull(字段2),0,字段2) from 表1 where 时间='2008.8.8'