> -----Original Message-----
> From: [email protected]
[mailto:[email protected]]
> On Behalf Of Sytze de Boer
> Sent: Tuesday, June 01, 2010 1:45 PM
> To: [email protected]
> Subject: Data type mismatch
> 
> My system imports data from several bank CSV files
> One of the fields is a character field that MAY include data which my
app
> wants to process
> 
> The code goes something like this
> go top
> scan
>    Nsrch=val(alltrim(analcode))
>    if Nsrch>0
>       sele glcodes     && indexed on Code, numeric 6,2
>       seek Nsrch
>       etc
> 
> Suddenly, yesterday, I received this error report, Data type mismatch
> 
> I found the following data in the field analcode, $1.35
> So it would give me Nsrch as 1.35, but bomb out on Data type mismatch
<snip>


You don't seem to be sanitizing your data...

Since you are getting these from a bank then you can't really control
the data validation, so you are stuck doing this during the import.

It would seem to me that the Fox is choking on the "$" either because it
can't do the VAL and/or ALLTRIM function on it (don't have it installed
here to try it out) or it assumes you have a Currency value, which I
would think the ALLTRIM function would blow up on...

I would either STRTRAN all these values attempting to remove anything
that would choke ALLTRIM, or sanitize it better by running it through a
TYPE case statement to determine what it is before trying to ALLTRIM it.

Thanks,
 
Matthew Jarvis || Business Systems Analyst
IT Department
McKenzie-Willamette Medical Center
1460 G Street, Springfield, OR  97477 || Ph: 541-744-6092 || Fax:
541-744-6145
--------------------------------------------------------------------------
Disclaimer: This electronic message may contain information that is
Proprietary, Confidential, or legally privileged or protected. It
is intended only for the use of the individual(s) and entity named
in the message. If you are not an intended recipient of this
message, please notify the sender immediately and delete the
material from your computer. Do not deliver, distribute or copy
this message and do not disclose its contents or take any action in
reliance on the information it contains.

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/69f310c05dd83c48a84ba3769ce1ecf803444...@tntriexevs02.triadhospitals.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to