Archive for Web and Database Development

Big time DBAs, don’t laugh! But honestly, couldn’t it have been easier to format a numeric value as an amount with decimals? Maybe it will help others trying to format dollar amounts which are stored like 1234.1861 in SQL Server to look like 1234.19, for example. So deceivingly simple…

Here is how I searched BigG and found little:

TSQL display dollar amount

TSQL format dollar amount

TSQL format currency no dollar sign

Just pop this around the field name you need to format and you’re in business!

CONVERT(VARCHAR(10), CONVERT(MONEY, fieldname)) AS PRICE

Cheers!

Comments (0)

Tags

 

September 2010
S M T W T F S
« Aug    
 1234
567891011
12131415161718
19202122232425
2627282930