Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error in conversion

Status
Not open for further replies.

wdbouk

Technical User
May 28, 2003
81
0
0
CA
I have a column full of numbers but in text format. I tried converting the column from text to number but i lost a lot of observations by doing so (error message). I am sure that all of the observations are numbers. it used to be 6 numbers + 3 letters and I updated the column to remove the letter by selecting left(column,6). Can Anyone tell me if their is a way to avoid losing the data through conversion (i need to convert them to export them to matlab which recognizes only number format and not text)
thx
 
What kind of "numbers" exactly. A "number" format may be bit, byte, single, double, long, integer, etc. You may be having a problem because the text can't be converted to the specific data type that your numbers have.
 
Why not simply use the Val function ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I tried all the number formats (byes, single, ling integer etcc) the only format that worket was replication ID and this format can't be read in matlab where i tend to extract my data.
the CInt returned more conversion errors than before.
any helo about the fval or if thge replication ID could be used to get only a maximum of 6 numbers without any letter.
Best
 
SELECT Val(column) AS NumField FROM yourTable

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top