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

Money Datatype

Status
Not open for further replies.

denoxis

Programmer
Jul 22, 2002
154
US
Is there any way to scale down the money datatype? There is always 4 decimal digits. I want only 2 digits, because some of the calculations on ASP side and MSSQL side returns 1 cent difference (very rare but it's not accurate)
 
Try converting to a varchar. This should return what you need rounded to the penny.

convert(varchar,moneycolumn)

 
If you are going to convert it, convert to decimal so it reamins a number rather than converting it to a string.

Select DecCol=Convert(decimal(10,2), MoneyCol)
From YourTable

You can also use the Round function in SQL Server.

Select RoundVal=Round(MoneyCol, 2)
From YourTable

Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
I think I will use the round function. There is no way to change the field I guess.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top