sql - Replace statement -



sql - Replace statement -

im trying build replace statements i'm getting error:

the replace function requires 3 argument(s).

incorrect syntax near keyword 'with'. if statement mutual table expression, xmlnamespaces clause or alter tracking context clause, previous statement must terminated semicolon.

sql script:

select ccc.*, replace(replace(replace(replace(replace(bbb.text, '[change]',convert(varchar,cast(coalesce(ccc.change,0) decimal(10,2)))), '[currentamount]','$'+convert(varchar,cast(coalesce(ccc.currentamount,0) money),1), '[increase]',convert(varchar,cast(coalesce(ccc.increase,0) decimal(10,2))))+ '%', '[amountincrease]',convert(varchar,cast(coalesce(ccc.amountincrease,0) decimal(10,2))))+ '%', '[amountdecrease]',convert(varchar,cast(coalesce(ccc.amountdecrease,0) decimal(10,2))))+ '%' ) status ccccheck ccc (nolock) inner bring together bbbcheck bbb (nolock)on...

select ccc.*, replace( replace( replace( replace( replace(bbb.text, '[change]', convert(varchar, cast(coalesce(ccc.change, 0) decimal(10, 2)))), '[currentamount]', '$' + convert(varchar, cast(coalesce(ccc.currentamount, 0) money), 1)), '[increase]', convert(varchar, cast(coalesce(ccc.increase, 0) decimal(10, 2))) + '%'), '[amountincrease]', convert(varchar, cast(coalesce(ccc.amountincrease, 0) decimal(10, 2))) + '%'), '[amountdecrease]', convert(varchar, cast(coalesce(ccc.amountdecrease, 0) decimal(10, 2))) + '%') status ccccheck ccc (nolock)

sql sql-server replace

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -