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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 2000 Displaying Decimals

Status
Not open for further replies.

arrian

Programmer
Nov 11, 2003
93
CA
I'm not entierly sure if this can be done... But I've got a few fields that I *ALWAYS* want to display 2 decimals (ie 3.40, 2.35, 1.00) I'm not entierly sure how I can do this. Anyone know?
 
Do you want to change the original data?

You could do this:
Code:
ALTER TABLE tablename
ALTER COLUMN columname DECIMAL(x,2)
The x has to be replaced with the maximum length of the data, including the decimal value. (1234.56 would be DECIMAL(6,2))

If you can't or don't want to change the columns, then SQLDenis' suggestion is the way to go.

-SQLBill

Posting advice: FAQ481-4875
 
If I change the column to decimal, though, will that ALLWAYS show 2 decimal points? I need it to show 1.10 and 1.00 as well...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top