VFP6 Operator/Operand Type Mismatch 
Author Message
 VFP6 Operator/Operand Type Mismatch

I'm using a VFP6 program that was created by a co-worker
who is no longer with my company.  I'm more of an
Access/VB person, but I'm trying to learn Foxpro.

I'm encountering a "Operator/Operand Type Mismatch" error,
and I cannot track down the cause for it.  Briefly, the
program is designed to search for duplicate records in  
large data files by matching a criteria string, and then
outputting them into a new table.  The error is occuring
on the line of code where it first begins looking at the
criteria string.  The line is:

index on emp_ssn+str(chg_amt*100)
+diag_cd1+proc_cd+pos_cd+pname+dos_to+dos_from+mem_rel+prov
_id to chekdupe.idx compact

Help says that this error will occur for example if two
logical fields are being added together, but all of the
fields are character fields except for the chg_amt field,
and it is being converted to a string.  Can someone help?  
I've got a very tight timeline on this project.

Thanks, Lee



Sun, 28 Aug 2005 23:09:28 GMT  
 VFP6 Operator/Operand Type Mismatch
*probably* an easy one but I'd need the table - can you email it to me and
I'll have a quick look for you.


Quote:
> I'm using a VFP6 program that was created by a co-worker
> who is no longer with my company.  I'm more of an
> Access/VB person, but I'm trying to learn Foxpro.

> I'm encountering a "Operator/Operand Type Mismatch" error,
> and I cannot track down the cause for it.  Briefly, the
> program is designed to search for duplicate records in
> large data files by matching a criteria string, and then
> outputting them into a new table.  The error is occuring
> on the line of code where it first begins looking at the
> criteria string.  The line is:

> index on emp_ssn+str(chg_amt*100)
> +diag_cd1+proc_cd+pos_cd+pname+dos_to+dos_from+mem_rel+prov
> _id to chekdupe.idx compact

> Help says that this error will occur for example if two
> logical fields are being added together, but all of the
> fields are character fields except for the chg_amt field,
> and it is being converted to a string.  Can someone help?
> I've got a very tight timeline on this project.

> Thanks, Lee



Sun, 28 Aug 2005 23:21:07 GMT  
 VFP6 Operator/Operand Type Mismatch
One of the fields must NOT be character.  I'd suggest you put a break point
at that line in the de{*filter*}, and see exactly what's in each of those
variables (or fields) at the time of the INDEX command.

Also be aware that an INDEX string can't be larger than 120 characters if
you're using a non-English character set.

--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.

Quote:

> I'm using a VFP6 program that was created by a co-worker
> who is no longer with my company.  I'm more of an
> Access/VB person, but I'm trying to learn Foxpro.

> I'm encountering a "Operator/Operand Type Mismatch" error,
> and I cannot track down the cause for it.  Briefly, the
> program is designed to search for duplicate records in
> large data files by matching a criteria string, and then
> outputting them into a new table.  The error is occuring
> on the line of code where it first begins looking at the
> criteria string.  The line is:

> index on emp_ssn+str(chg_amt*100)
> +diag_cd1+proc_cd+pos_cd+pname+dos_to+dos_from+mem_rel+prov
> _id to chekdupe.idx compact

> Help says that this error will occur for example if two
> logical fields are being added together, but all of the
> fields are character fields except for the chg_amt field,
> and it is being converted to a string.  Can someone help?
> I've got a very tight timeline on this project.

> Thanks, Lee

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ( http://www.*-*-*.com/ ).
Version: 6.0.459 / Virus Database: 258 - Release Date: 2/25/2003


Sun, 28 Aug 2005 23:20:50 GMT  
 VFP6 Operator/Operand Type Mismatch
Besides Fred's idea you could try indexing several times, each time with a
piece of your string missing. That would narrow down the offending
expression.

By the way, nobody uses the single IDX files these days. Just use >INDEX ON
... TAG MyOrder< and a CDX file will be built that matches your table. When
you open the table the index will open. To set the order use >SET ORDER TO
[TAG] MyOrder<.

--
Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP

http://msdn.microsoft.com/vfoxpro  http://foxcentral.net


Quote:
> I'm encountering a "Operator/Operand Type Mismatch" error,

> index on emp_ssn+str(chg_amt*100)
> +diag_cd1+proc_cd+pos_cd+pname+dos_to+dos_from+mem_rel+prov
> _id to chekdupe.idx compact
> Thanks, Lee



Mon, 29 Aug 2005 02:38:48 GMT  
 VFP6 Operator/Operand Type Mismatch
Hi, Fred!
You wrote  on Wed, 12 Mar 2003 08:20:50 -0700:

 FT> Also be aware that an INDEX string can't be larger than 120 characters
 FT> if you're using a non-English character set.

IMHO it should be read as:

If you are using non-Machine collating sequence.

I assume that under "INDEX string" you mean index key length.

WBR, Igor



Mon, 29 Aug 2005 01:53:37 GMT  
 VFP6 Operator/Operand Type Mismatch
Yes, you're correct Igor.  I do mean the key length.  I so very rarely deal
with anything other than MACHINE for the COLLATE sequence, that I got the
terms mixed up.  I *think* this is also a problem for any double-byte type
characters, maybe that's why I thought non-English.

--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.

Quote:

> Hi, Fred!
> You wrote  on Wed, 12 Mar 2003 08:20:50 -0700:

>> Also be aware that an INDEX string can't be larger than 120
>> characters if you're using a non-English character set.

> IMHO it should be read as:

> If you are using non-Machine collating sequence.

> I assume that under "INDEX string" you mean index key length.

> WBR, Igor

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 2/25/2003


Mon, 29 Aug 2005 23:16:38 GMT  
 VFP6 Operator/Operand Type Mismatch
Bonjour Cindy Winegarden
Pour mmoire, tu nous as crit :

Quote:
> Besides Fred's idea you could try indexing several times, each time
> with a piece of your string missing. That would narrow down the
> offending expression.

> By the way, nobody uses the single IDX files these days. Just use
> >INDEX ON ... TAG MyOrder< and a CDX file will be built that matches
> your table. When you open the table the index will open. To set the
> order use >SET ORDER TO [TAG] MyOrder<.

Though the "rule" you suggest in usualy the way to go, if this tag is used
only for "maintenance" purpose, i'd say that, depending on how records are
added (and some other shared stuff we like to "optimize"), Lee is right to
use volatile idx files...

just my 2%

Fred



Mon, 29 Aug 2005 23:22:47 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Operator/operand type mismatch ERROR

2. Operator/Operand Type Mismatch

3. Operator/operand type mismatch message

4. operand type mismatch in report?

5. Operator mismatch with list

6. Help: Data Type Mismatch error with forms

7. Data Type Mismatch

8. Data type mismatch in criteria expression.

9. Data type mismatch in a SELECT

10. Data type mismatch error

11. Data type mismatch - HOW????

12. TableUpdate() and data type mismatch?

 

 
Powered by phpBB® Forum Software