Sorry, I'm not sure where to post this question.
This query has a problem:
SELECT CAST(SpecValue AS Numeric) AS Expr1
FROM dbo.tblSpecification
WHERE (IsNumeric(SpecValue) = 1) AND (SpecValue Like N'%,%')
(btw SpecValue nvarchar(50))
How do I explicitly Cast a string like "10,000" into numeric?
Thanks
--
Patget rid of the comma
declare @.v varchar(49)
select @.v ='10,000'
select convert(numeric(15,4),replace(@.v,',','')
),
convert(numeric(15,4),convert(money,@.v))
Denis the SQL Menace
http://sqlservercode.blogspot.com/
No comments:
Post a Comment