Link to home
Start Free TrialLog in
Avatar of maqskywalker
maqskywalker

asked on

t-sql money data type decimal places

I'm using sql server 2008

I have a money column in sql server.
The data in the column has 4 decimal places.

In my select query how to i display only 2 decimal places?
Avatar of _agx_
_agx_
Flag of United States of America image

Round() or Cast as type decimal, with two decimal places

DECLARE @money money
SET @money = 19.7562            
DECLARE @money money
SET @money = 19.7562            
SELECT  CAST(@money AS DECIMAL(18,2))
		, ROUND(@money, 2)

Open in new window

SOLUTION
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maqskywalker
maqskywalker

ASKER

thanks.