Discussion:
Operator/operand type mismatch
(too old to reply)
eric wu
2008-09-27 21:39:41 UTC
Permalink
Structure for table mstr
Table type Microsoft Visual FoxPro Driver
Last update 09/27/2008
-------------------------------------------------------------------------
Field Field Name Type Length Dec Index
1 m_id CHAR 15 Y
2 m_etd DATE 10 N

SELECT m_id, m_etd FROM mstr WHERE m_etd > '9/1/08'

Server Error: [Microsoft][ODBC Visual FoxPro Driver]Operator/operand type
mismatch.

anybody know what's wrong ?
Bruce Beacham
2008-09-28 08:00:07 UTC
Permalink
Post by eric wu
2 m_etd DATE 10 N
SELECT m_id, m_etd FROM mstr WHERE m_etd > '9/1/08'
Server Error: [Microsoft][ODBC Visual FoxPro Driver]Operator/operand
type mismatch.
anybody know what's wrong ?
You could try:

SELECT m_id, m_etd FROM mstr WHERE m_etd > '9/1/2008'



Bruce Beacham
Ronnie MacGregor
2008-09-28 08:07:34 UTC
Permalink
On Sun, 28 Sep 2008 09:00:07 +0100
Post by Bruce Beacham
SELECT m_id, m_etd FROM mstr WHERE m_etd > '9/1/2008'
You could also try:

SELECT m_id, m_etd FROM mstr WHERE m_etd > '09.01.2008'
--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk
Bruce Beacham
2008-09-28 12:19:08 UTC
Permalink
Post by Ronnie MacGregor
On Sun, 28 Sep 2008 09:00:07 +0100
Post by Bruce Beacham
SELECT m_id, m_etd FROM mstr WHERE m_etd > '9/1/2008'
SELECT m_id, m_etd FROM mstr WHERE m_etd > '09.01.2008'
On Sun, 28 Sep 2008 09:00:07 +0100
Post by Bruce Beacham
SELECT m_id, m_etd FROM mstr WHERE m_etd > '9/1/2008'
SELECT m_id, m_etd FROM mstr WHERE m_etd > '09.01.2008'
Good thinking.! As it says in the clear article on Date Formats in
Local SQL Help:
"There are two acceptable formats for the date parts of DATE and
TIMESTAMP literals in local SQL statements: the US date format and the
European date format. Which one of the two you use is predicated on the
Windows configuration settings for Date Separator and Short Date Style."


Bruce
unknown
2008-09-28 19:43:17 UTC
Permalink
On Sun, 28 Sep 2008 13:19:08 +0100 Bruce Beacham
Sender: Bruce Beacham <***@beacham.no-spam.co.uk>
wrote the following in:
Newsgroup: dbase.programming
Post by Bruce Beacham
Post by Ronnie MacGregor
Post by Bruce Beacham
SELECT m_id, m_etd FROM mstr WHERE m_etd > '9/1/2008'
SELECT m_id, m_etd FROM mstr WHERE m_etd > '09.01.2008'
Good thinking.!
Hmm. Eric's original message quoted the result of a DISPLAY STRUCTURE command which contained two
dates, both using forward slashes as date separators and one of the dates is of type MDY, indicating
that he is probably using American dates.


Ivar B. Jessen
Post by Bruce Beacham
Structure for table mstr
Table type Microsoft Visual FoxPro Driver
Last update 09/27/2008
-------------------------------------------------------------------------
Field Field Name Type Length Dec Index
1 m_id CHAR 15 Y
2 m_etd DATE 10 N
SELECT m_id, m_etd FROM mstr WHERE m_etd > '9/1/08'
Bruce Beacham
2008-09-28 20:41:33 UTC
Permalink
Post by unknown
Hmm. Eric's original message quoted the result of a DISPLAY STRUCTURE command which contained two
dates, both using forward slashes as date separators and one of the dates is of type MDY, indicating
that he is probably using American dates.
I (in the UK) just opened a table I created for my own app and ran DISP
STRU and got this:
Last update 26/09/2008

So that isn't necessarily definitive, as his file date is 9/1/08, which
_could_ be either way round (but, yes, OK, it's September just now!).


Bruce
Geoff Wass [dBVIPS]
2008-10-03 05:20:27 UTC
Permalink
Post by eric wu
Structure for table mstr
Table type Microsoft Visual FoxPro Driver
Last update 09/27/2008
-------------------------------------------------------------------------
Field Field Name Type Length Dec Index
1 m_id CHAR 15 Y
2 m_etd DATE 10 N
SELECT m_id, m_etd FROM mstr WHERE m_etd > '9/1/08'
Server Error: [Microsoft][ODBC Visual FoxPro Driver]Operator/operand type
mismatch.
anybody know what's wrong ?
Eric,

Just a guess: use a date like '09/01/2008' (mm/dd/yyyy)

Are you using the correct driver for the version of table you are using?
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
unknown
2008-10-04 05:43:48 UTC
Permalink
On Fri, 3 Oct 2008 21:40:20 -0500 eric wu
Sender: "eric wu" <***@hotmail.com>
wrote the following in:
Newsgroup: dbase.programming
SELECT q1_date
FROM qu1
WHERE q1_date > '09/01/2008'
Server Error: [Microsoft][ODBC Visual FoxPro Driver]Operator/operand type
mismatch.
qu1.* attached (it's a Visual FoxPro table )
Eric,

The posted dbase table named qu1.dbf is damaged; the table header is missing.


Ivar B. Jessen

Loading...