I'm trying to convert the values from the column Debit; if the values is blank it should convert to 0 otherwise it should convert the value to a decimal.
Here's what I've done so far:
CONVERT(Decimal(18, 2), (CASE Debit WHEN ' ' THEN 0 END)
It works, but I want to retain the value if its not a blank. How would I do that?
CONVERT(Decimal(18, 2), REPLACE(Debit, ' ', '0'))suggested by ahillier88