Try select cast(.010000000 as decimal(18, 2))


Steve

-----Original Message-----
From: Won Lee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 19, 2004 4:45 PM
To: CF-Talk
Subject: RE: return only 2 decimal places

I tried round.  It seems it returns the same amount of decimal places as
the numeric value working on.

select round(.011344999555, 2)

returns .010000000000

select round(.011344999555, 2, 1) - which is supposed to truncate
returns .010000000000

At 16:39 5/19/2004 -0400, you wrote:
>Take a look in Books Online for the ROUND() function - it'll do everything
>you need.
>
>Jim Davis
>
>   _____
>
>From: Won Lee [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 19, 2004 4:31 PM
>To: CF-Talk
>Subject: SQL: return only 2 decimal places
>
>Hello,
>
>Using SQL Server 2000.
>I want to keep as much work on the SQL server.
>
>I have a numeric value that I want to return as a 2 decimal place number.
>10.98
>1.34
>03.45
>.34
>
>All valid returns.  How can I do this?  I can't run a substring on a
>numeric value.  Should I cast it then work on it?  Shouldn't there be an
>easier way?
>
>   _____
>
>----------
>[<http://www.houseoffusion.com/lists.cfm/link=t:4>Todays Threads]
>[<http://www.houseoffusion.com/lists.cfm/link=i:4:163730>This Message]
>[<http://www.houseoffusion.com/lists.cfm/link=s:4>Subscription]
>[<http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=9550.8683.4>Fa
st
>Unsubscribe] [<http://www.houseoffusion.com/signin/>User Settings]
>
>----------
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to