dbTalk Databases Forums  

Operator/operand type mismatch

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss Operator/operand type mismatch in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
LawyerKill
 
Posts: n/a

Default Operator/operand type mismatch - 11-01-2003 , 06:41 PM






Hi

I'm having a problem that I can't solve, maybe someone can tell me what I'm
doing wrong. I have a table called Data 101, two of the field I'm interested in
are named Distance(Numeric format) and Tdate(Date format). I'm trying to find
all the distance for a certain date(Tdate).

Here is what I tried,

SELECT Distance;
from Data101;
where Tdate=01/27/2002;
INTO ARRAY sps

I run it and rather then put the Distances into the array, I get this error
message,

"Operator/operand type mismatch"

Now I also tried this,

SELECT Distance;
from Data101;
where Tdate=' 01/27/2002';
INTO ARRAY sps

and get the same error message.

Anyone have a clue?

Thanks


Reply With Quote
  #2  
Old   
LawyerKill
 
Posts: n/a

Default Re: Operator/operand type mismatch - 11-01-2003 , 06:49 PM






Oh, I'm using FOXPRO 7.0

Reply With Quote
  #3  
Old   
Josh Assing
 
Posts: n/a

Default Re: Operator/operand type mismatch - 11-01-2003 , 07:10 PM



Quote:
SELECT Distance;
from Data101;
where Tdate=01/27/2002;
INTO ARRAY sps
in this one, you are comparing your "date field" (tdate) to a numeric value: 1
DIVIDED BY 27 DIVIDED BY 2002

Quote:
SELECT Distance;
from Data101;
where Tdate=' 01/27/2002';
INTO ARRAY sps
Now you are comparing your "date field" (tdate) to a character string
"01/27/2002"


What you want is:

select distance;
from data101
where tdate = date(2002,27,1) ;
into array sps




Reply With Quote
  #4  
Old   
Josh Assing
 
Posts: n/a

Default Re: Operator/operand type mismatch - 11-01-2003 , 07:10 PM



wouldnt' matter what version of foxpro (dos, windows, vfp)....



On 02 Nov 2003 00:49:36 GMT, lawyerkill (AT) aol (DOT) com (LawyerKill) wrote:

Quote:
Oh, I'm using FOXPRO 7.0


Reply With Quote
  #5  
Old   
LawyerKill
 
Posts: n/a

Default Re: Operator/operand type mismatch - 11-01-2003 , 07:48 PM



Thanks a lot Josh, you're right!

Peace
John

Reply With Quote
  #6  
Old   
LawyerKill
 
Posts: n/a

Default Re: Operator/operand type mismatch - 11-01-2003 , 07:56 PM



Josh Assing
Quote:
What you want is:

select distance;
from data101
where tdate = date(2002,27,1) ;
into array sps
What you said make sense, I use the above exactly like it is and now I get a
query table that comes up then and error box that says, "Unrecognized command
verb" and the, "where tdate = date(2002,27,1) ;" highlighted.


Reply With Quote
  #7  
Old   
Anthony Shipley --- Remove NUMERALS to reply
 
Posts: n/a

Default Re: Operator/operand type mismatch - 11-01-2003 , 08:33 PM



lawyerkill (AT) aol (DOT) com (LawyerKill) [WA] wrote:

Quote:
Josh Assing
What you want is:

select distance;
from data101
where tdate = date(2002,27,1) ;
into array sps

What you said make sense, I use the above exactly like it is and now I get a
query table that comes up then and error box that says, "Unrecognized command
verb" and the, "where tdate = date(2002,27,1) ;" highlighted.
Add a semi-colon after "from data101".
..
regards - anthony shipley

look, ma - no .sig


Reply With Quote
  #8  
Old   
Josh Assing
 
Posts: n/a

Default Re: Operator/operand type mismatch - 11-01-2003 , 08:53 PM




sorry; missed the ';' after data101

On 02 Nov 2003 01:56:10 GMT, lawyerkill (AT) aol (DOT) com (LawyerKill) wrote:

Quote:
Josh Assing
What you want is:

select distance;
from data101
where tdate = date(2002,27,1) ;
into array sps

What you said make sense, I use the above exactly like it is and now I get a
query table that comes up then and error box that says, "Unrecognized command
verb" and the, "where tdate = date(2002,27,1) ;" highlighted.


Reply With Quote
  #9  
Old   
LawyerKill
 
Posts: n/a

Default Re: Operator/operand type mismatch - 11-01-2003 , 08:59 PM



Josh Assing
Quote:
sorry; missed the ';' after data101

LK

Thanks, I tried that but got a new error message when I added the ';' after
data101,"Function argument value, type or count is invalid". Well you been
very kind and I don't want to take anymore of your time I'll just play around
with it and see what happens, again many thanks.


Reply With Quote
  #10  
Old   
LawyerKill
 
Posts: n/a

Default Re: Operator/operand type mismatch - 11-01-2003 , 09:00 PM



Quote:
Add a semi-colon after "from data101".
.
regards - anthony shipley
Thanks Anthony I tried that but off a new error message.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.