Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a money field

Status
Not open for further replies.

khue

Programmer
Mar 6, 2001
112
US
When I create a field of type money, how do I set this field to be only 2 decimal point precision? i.e. 9999.99
 
You can't; money and smallmoney inherently support four digits of decimal precision.

You can toy with Convert() to convert it for display, though. Robert Bradley
Sr. DBA, some big company
cheap prints and oil paintings:
 
I have toy around with the Convert() but still get a 4 decimal place precisions. Is there any way around this?
 
Try using the style of 1, as in this example:

[tt]declare @MyMoney smallmoney
select @MyMoney = $123.45
select convert(char(15), @MyMoney, 1)[/tt]


Robert Bradley
Sr. DBA, some big company
cheap prints and oil paintings:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top