Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

 SQL Server Forums Profile | Active Topics | Members | Search | Forum FAQ
 All Forums  SQL Server 2000 Forums  SQL Server Administration (2000)  Two digits after decimal point Reply to Topic  Printer Friendly
Author  Topic

Aged Yak Warrior

583 Posts

 Posted - 04/15/2005 :  12:22:12 "Money" data type provides 4 digits after decimal point. I need 10 digits for integer part and only two digits as fractional part.Canada DBA

Aged Yak Warrior

583 Posts

 Posted - 04/15/2005 :  12:44:15 Found it: Decimal(12,2)``` DECLARE @M Decimal(12,2) SET @M = 1234567890.09 SELECT @M ```Canada DBA

Bustaz Kool
Flowing Fount of Yak Knowledge

USA
1834 Posts

 Posted - 04/15/2005 :  19:58:49 FWIW - Every accounting package that I've worked with carries money values to at least three decimal places.HTH=================================================================Every act of conscious learning requires the willingness to suffer an injury to one's self-esteem. That is why young children, before they are aware of their own self-importance, learn so easily; and why older persons, especially if vain or important, cannot learn at all. -Thomas Szasz, author, professor of psychiatry (1920- )

robvolk
Most Valuable Yak

USA
15732 Posts

 Posted - 04/15/2005 :  20:33:09 If you only need to DISPLAY 2 decimal places, but not actually round off the value, then do it in your application/presentation layer, or use the CONVERT() or STR() SQL functions to convert it to a string/varchar.You are better off using money/smallmoney rather than decimal if you're storing monetary values. As Bustaz said, you get more accuracy with money, and it's more efficiently stored and calculated than decimal types.