I want to convert a Decimal field to a Char / Varchar. CAST & few other function are useful but in a scenario like:
Decimal value : -0.000124 (Minus sign at start position)
the output is coming as '-.000124'. I need the o/p to be '-0.000124'.
You have to add a format:
cast((col (FORMAT '-(X)9.9(Y)')) as char(...))
where X is the number of digits before the decimal separator and Y the fractional digits.