Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Limuh
Yak Posting Veteran
94 Posts |
Posted - 2008-03-28 : 02:23:14
|
| im trying to convert this Code from Varchar to Numeric(CAST(ISNULL(del.[Day 60 AMT],0) AS NUMERIC(6,3))+ CAST(ISNULL(del.[Day 90 AMT],0) AS NUMERIC(6,3)) + CAST(ISNULL(del.[Day 120 AMT],0)AS NUMERIC(6,3)) + CAST(ISNULL(del.[Day 150 AMT],0)AS NUMERIC(6,3)) + CAST(ISNULL(del.[Day 180 AMT],0)AS NUMERIC(6,3)) + CAST(ISNULL(del.[Day 210+ AMT],0)AS NUMERIC(6,3))) > 0i got an error please help. |
|
|
pravin14u
Posting Yak Master
246 Posts |
Posted - 2008-03-28 : 02:25:06
|
| Can you give the error description and the exact query that you are trying to run? |
 |
|
|
Limuh
Yak Posting Veteran
94 Posts |
Posted - 2008-03-28 : 02:27:48
|
| Server: Msg 8114, Level 16, State 5, Line 1Error converting data type varchar to numeric.this is the error message |
 |
|
|
KenW
Constraint Violating Yak Guru
391 Posts |
Posted - 2008-03-28 : 16:26:51
|
| Then you obviously have something in a varchar column that can't be converted to a numeric, just like the error message says.The solution is easy:1. Look at the data2. Find the non-numeric values in the varchar column3. Fix or delete those rowsOf course, you could have just read the error message yourself and fixed it, without waiting for someone here to post. |
 |
|
|
GhantaBro
Posting Yak Master
215 Posts |
Posted - 2008-03-28 : 16:43:38
|
| if you do something like select * from tble where isdigit(ltrim(rtrim(col))) = 0you will see the problems. |
 |
|
|
|
|
|
|
|