sql - Switch Negative Sign from Back to Front of Value -
i have 5 fields in sql table varchar
fields. data in these fields money amounts, negative values have sign @ end of number, rather front.
example: 4.56-
how can change these fields varchar
money
, switch negative sign front of values in process?
i have tried cast([field_name] money)
hasn't worked. have gotten following error attempt:
cannot convert char value money. char value has incorrect syntax.
detect minus sign; remove it; cast positive result money; , negate it.
case when [field_name] '%-' -(cast(replace([field_name],'-','') money)) else cast([field_name] money) end
Comments
Post a Comment