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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -