|
Posted by Plamen Ratchev on 12/26/07 20:02
Formatting is normally the job of the presentation/reporting layer, where
this is done best.
If the price is numeric then one way is to cast it to the correct decimal
precision (note that rounding will occur):
SELECT CAST(5.0000 AS NUMERIC(10, 2))
If it is character data type, then:
SELECT LEFT('5.0000', LEN('5.0000') - 2),
STUFF('5.0000', LEN('5.0000') - 2, 2, '')
HTH,
Plamen Ratchev
http://www.SQLStudio.com
[Back to original message]
|