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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 number formating in the SQL?

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2010-02-24 : 13:48:24
HI I would like the 'expense' field to be with 2 decimals places
SELECT SOP10200.XTNDPRCE * SOP10200.QUANTITY As Expense

where and how do i put this?

Thank you,
AW

Kristen
Test

22859 Posts

Posted - 2010-02-24 : 14:08:25
SELECT ROUND(SOP10200.XTNDPRCE * SOP10200.QUANTITY, 2, 0) As Expense

Final parameter is 0=Round, 1=Truncate
Go to Top of Page

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2010-02-24 : 14:21:03
Thanks for that!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-25 : 09:22:24
you dont need to pass third parameter with 0 value explicitly as its the default value

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -