E-Risk
asked on
Sum of a VarChar Field
How to I perform a sum on a varchar field that always contains numeric content?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Now , if it stores a numeric field always, they ehy you keep it as a varchar column ?
select sum(cast(fieldName as int)) from tableA
Will find the sum (assumin that the numbers you have are integers)
Will find the sum (assumin that the numbers you have are integers)
WHERE ISNUMERIC(varcharColumn) =1