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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 column convert into decimal from nvarchar

Author  Topic 

suman.reddy39
Starting Member

34 Posts

Posted - 2009-02-12 : 06:27:36
dear all,
i got an issue in a select statement where
select convert(decimal(12,4),COLUMN04) from TABLE104
select convert(decimal(12,4),COLUMN02) from TABLE057
first select statement is runing fine but the second is giveing an error

--Error converting data type nvarchar to numeric.
please help me in this regards...y its happening

Thanks in Advance.

Don't go the way Life takes you, Take the Life the way you go

subbi

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-12 : 06:32:18
[code]select case isnumeric(COLUMN04)
when 0 then convert(decimal(12,4), null)
else convert(decimal(12,4),COLUMN04)
end
from TABLE104[/code]


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

suman.reddy39
Starting Member

34 Posts

Posted - 2009-02-12 : 06:34:34
thanks dude..

Don't go the way Life takes you, Take the Life the way you go

subbi
Go to Top of Page
   

- Advertisement -