Guest_imported
New member
- Jan 1, 1970
- 0
Please see below : -
1> select reference, amount, decimals, "display"=
2> (case decimals
3> when 1 then (convert(numeric(5,1), amount / power (10,decimals)))
4> when 2 then (convert(numeric(4,2), amount / power (10,decimals)))
5> when 0 then (convert(numeric(6,0), amount / power (10,decimals)))
6> end)
7> from casetest
8> go
reference amount decimals display required
--------- ------ -------- -----------
ABCD 1234 0 1234.00 1234
EFGH 2345 1 234.00 234.5
IJKL 3456 2 34.00 34.56
How do I get my "required" values back ?
Thanks
1> select reference, amount, decimals, "display"=
2> (case decimals
3> when 1 then (convert(numeric(5,1), amount / power (10,decimals)))
4> when 2 then (convert(numeric(4,2), amount / power (10,decimals)))
5> when 0 then (convert(numeric(6,0), amount / power (10,decimals)))
6> end)
7> from casetest
8> go
reference amount decimals display required
--------- ------ -------- -----------
ABCD 1234 0 1234.00 1234
EFGH 2345 1 234.00 234.5
IJKL 3456 2 34.00 34.56
How do I get my "required" values back ?
Thanks