William Kossack wrote:
I have a table with a date/time field that is not required. The actual
purpose of the field is to indicate when something was stopped.
Therefore, in my select
select field1, field2, dtfield from table
where dtfield > 0 returns the wrong records
If tried null and nz but only get errors from odbc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Since the column is a DateTime data type why not use expressions that
evaluate DateTime data types. You've set up your query to evaluate a
DataTime against an numeric data type.
Perhaps something like this:
SELECT Col1, Col2, DateColumn
FROM TableName
WHERE DateColumn IS NOT NULL
AND DateColumn > '2004-01-01'
Supply a default date (in this case 1 Jan 2004) instead of ZERO. In
different RDBMS ZERO can refer to different dates (in JET [Access] dbs
ZERO = 30 Dec 1899, in SQL Server ZERO = 1 Jan 1900).
- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQGxoQIechKqOuFEgEQINHACeKa6OA+MMgGE8DhyRWY27A5 K6InUAoJJi
IlRbs6B5PV1qRkRt+Ua3uOn+
=EuxH
-----END PGP SIGNATURE-----