1.在Access中可以用下面的查询语句:
SELECT field FROM table WHERE boolField=TRUE
-- or
SELECT field FROM table WHERE boolField=FALSE
2.这两条语句在SQL Server中通不过,所以要改成下面的形式:
SELECT field FROM table WHERE bitField=1
-- or
SELECT field FROM table WHERE bitField=0
3.令人烦恼的是上面这两条语句在Access中也会出问题,因为Access把-1当作True,而不是1。在搞清楚了这个问题后,我们可以写出在两种环境中都能运行的查询语句:
SELECT field FROM table WHERE bitField<>0
-- or
SELECT field FROM table WHERE bitField=0