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)
 Doubt in Truncating Decimals..

Author  Topic 

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2008-05-22 : 04:26:56
Hello

I need a help ..
I need to convert 45.4593251 to 45.46

How to achieve it.
Can any one help me please..

Thanks
Ganesh

Solutions are easy. Understanding the problem, now, that's the hard part

banavalikar
Starting Member

3 Posts

Posted - 2008-05-22 : 04:29:44
Use the following TSQL:

round(CONVERT(float(3), variable_name), 2)

Regards,
Krishna [MCP, MCTS]
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-05-22 : 04:38:51
Or this:

Select Convert(numeric(5,2), 45.4593251)


Or else, do it in the front-end.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2008-05-22 : 04:43:57
thank you very much..
Go to Top of Page
   

- Advertisement -