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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error converting the data

Status
Not open for further replies.

wdbouk

Technical User
May 28, 2003
81
CA
hello,

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
 
i dont get it, the data is all numeric and still ur unable to convert the column into a numeric type?

i would suggest creating one more column of a numeric type and update the text column's data into this numeric column.

see if there errors are thrown...

Known is handfull, Unknown is worldfull
 
I created a new column (number format) and i run an update query where the value in the new colum is equal to the test column . I received the following err:

Microsoft didn't update 19811 field(s) due to a type conversion error. Any other hint
 
can i have ur query?

Known is handfull, Unknown is worldfull
 
Hi It is very simple.

I added a column (Field1) in the table and i made its format a number format then I wrote the update query:
UPDATE All SET Field1=Cusip;
where the table is "All" and the cusip column has a text format
 
try this:
UPDATE All SET Field1=cast(Cusip as numeric)

Known is handfull, Unknown is worldfull
 
there is a syntax error in the UPDATE All SET Field1=cast(Cusip as numeric) expression. i tried many changes without success.
 
what is the numeric precision and scale of the field in the table?

This does not give me a syntax error when I validate this statement

UPDATE [All] SET Field1=cast(Cusip as numeric)

It gives me a 'Invalid object name 'All'.' error

what is the exact error message that you are getting?

Denis The SQL Menace
SQL blog:
Personal Blog:
 
Let's stop the ball for a second...

> Microsoft didn't update 19811 field(s) due to a type conversion error.

Microsoft what? Access? :>

------
[small]select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')[/small]
[banghead]
 
sybtax error (missing operator)in query expression 'cast (cusip as numeric)'
 
You are using Microsoft SQL Server, correct?

-SQLBill

Posting advice: FAQ481-4875
 
yes. :) Sql microsoft access

Then the answer was NO. I asked if you were using Microsoft's SQL Server. That is a different database from Microsoft Access. SQL Server uses Transact-SQL, Access uses Jet-SQL.

-SQLBill

Posting advice: FAQ481-4875
 
sorry for that. i am not very familiar with Access and simply trying to organize the data and export it to matlab :)
 
So, do as SQLDenis suggested and post in Forum701. That's the forum for Microsoft Access.

-SQLBill

Posting advice: FAQ481-4875
 
sorry for the inconvinience. i will post the same thread in 701
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top