Those aren't numbers remember, and need to be in single quotes.
Even so, I'll be a bit surprised if this works against Access through
ODBC...
-Zo
-----Original Message-----
From: Christian Sandfeld
Sent: Thu 11/15/2001 9:56 AM
To: [EMAIL PROTECTED]
Cc:
Subject: RE: [PHP-DB] Converting "text" fields to "integer" in
queries with ODBC connection to an MS Access file
Lorenzo,
That was a good suggestion (had forgotten about the between
function) but
unfortunately it still complains with the following error:
Warning: SQL error: [Microsoft][ODBC Microsoft Access 97 Driver]
Data type
mismatch in criteria expression., SQL state 22005 in
SQLExecDirect in
test.php on line 6
What caused this error was this:
WHERE PARTNUMBER.PARTNUMBER BETWEEN 370100000 AND 500000000");
So, any other suggestions on how I can circumvent this problem?
Brgds,
Christian
-----Original Message-----
From: Gonzalez, Lorenzo [mailto:[EMAIL PROTECTED]]
Sent: 15. november 2001 14:57
To: Christian Sandfeld; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Converting "text" fields to "integer" in
queries
with ODBC connection to an MS Access file
Some of the databases I work with would support this as
'between' on two
text fields that are sortable alphabetically - I'd give that a
try.
-Lorenzo
-----Original Message-----
From: Christian Sandfeld
Sent: Thu 11/15/2001 7:55 AM
To: '[EMAIL PROTECTED]'
Cc:
Subject: [PHP-DB] Converting "text" fields to "integer"
in
queries with ODBC connection to an MS Access file
Hi list,
I wonder if anyone can help me out here. I'm pulling
some data
from an MS
Access file using the ODBC driver provided with Windows
NT 4.0
server
(Option pack, and SP6a applied), and want to limit the
result
set with a
where clause like this one:
... WHERE (PARTNUMBER > 370100000) AND
(PARTNUMBER <
500000000)
Now - the problem here is that the "PARTNUMBER" field is
defined
as a "text"
field in the access file (even though it holds only
numbers),
and since I'm
not the one maintaining the access base, I can't change
that. So
I tried
converting the field to an INTEGER field using the
CONVERT()
function in my
query. But this function is not supported by the ODBC
driver.
Does anyone know how I can convert the value of as
"text" field
to an
"integer" type field so I can do >/< clauses in my
query?
Any help will be greatly appreciated.
Brgds,
Christian
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
To contact the list administrators, e-mail:
[EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
[EMAIL PROTECTED]