Data Type mismath errors after months of no problems

S

scott Wilson

I have a CSV value that comes over as a string of
between 1 and 6. I have used the Val() function to
converto to a number and using a <6 in the selection
criteria of the query to only look at 1 through 5. It has
worked great for many months. Today I get a data type
mismatch error. I examine my query and my selection
criteria of <6 has been changed to <"6". I change it back
and no help. I remove the selection criteria and the
value is "right" justified in the column like a number.
The problem is in both the runtime and developer
plateforms. It is Access 2003. What has happened? Any
help would be greatly appreciated.

Scott in Charlotte, NC
 
M

[MVP] S.Clark

Access thinks the datatype of the table is a text, so it puts the criteria
in quotes.

Instead of Val() try using Cint, Clng, Cdbl, or Csng.


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
G

Guest

Thanks for the input. It turns out my problem was that I
had a blank (null) value in the field for some records. I
have a workaround to force a "0" where the null used to
be. Thanks for your input.

Scott in Charlotte, NC
 
Top