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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Need to convert numeric to char

Author  Topic 

snufse
Constraint Violating Yak Guru

469 Posts

Posted - 2010-12-15 : 17:04:03
Have following:

Have an "employee_rate" field that is numeric(9) long and implicit have 3 decimals (this is a field in a db2/400 table). I need to show this field with 3 decimals in a character field

When selecting this field I do like this:

employee_rate / 1000 and insert into a character field which is 9 long into a temp table. The result is example 36.250000 (always with 3 decimals) and I need to see it as 36.250.

How can I accomplish what I need? Thank you.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-12-15 : 17:12:11
You can use the ROUND function or even CONVERT it to DECIMAL with a precision of 3.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -