[RadiusNT] MS Access & ODBC (not RadiusNT related, but help me)

S.Tumurbaatar ( (no email) )
Tue, 3 Aug 1999 19:19:32 +0800

I have some problem with MS Access and ODBC.
I've created Access database to use with RadiusNt and now I'm
trying to work with it via ODBC. And some strange behavoir with
SQL statements. When I use INSERT command with date/time
value like (some fields are ommited):

INSERT INTO MasterAccounts (Active,maExpireDate)
VALUES (1, 10/20/1999)

it places invalid date/time to table, but doesnt raises any error.
So I enclosed date value in single quotes:

INSERT INTO MasterAccounts (Active,maExpireDate)
VALUES (1, '10/20/1999')

Now it inserts correct date value, but other query statement starts
to cause error:

SELECT COUNT(*) FROM MasterAccounts a
WHERE a."Active" <> 0
AND (maExpireDate IS NULL OR maExpireDate > '8/3/1999')

In this case ODBC expects date/time value without quotes. Ie INSERT
command requires some syntax for date const-s, but SELECT (or relational
commands) doesnt requires different format for date values.
Is it default behavoir of ODBC/MS Access SQL or I'm making a mistake

PS: I know that I should post such questions to other ODBC related
news/forums, but during last days I've sent several questions to MS's ODBC
newsgroups and did not get any answer.

For more information about this list (including removal) go to: