SQL - Converting from VARCHAR to Decimal

~J~

~J~

Soldato
Joined
20 Oct 2003
Posts
7,558
Location
London
I've got a table which has a field that can hold a multitude of values.

What I want to do is SUM up the field, if it can't convert the text, then it ignores it and/or gives it a zero.

I get an error which reads "Error converting varchar to numeric"

Anyone know how I can SUM up the column, ignoring any errors it finds along the way?

TIA
 
Ahhh, sorry, using SQL Server 2000.

Tried the Convert and Cast commands, but getting the same error.
 
Back
Top Bottom