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)
 no decimals in query

Author  Topic 

palak
Yak Posting Veteran

55 Posts

Posted - 2008-06-24 : 12:32:26
in quantity column - i have

100.00000

but i want only 100

no decimals..

how to get that?


thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-24 : 12:47:39
Just convert to int and it'll chop off the decimal places.

SELECT CONVERT(int, YourColumn)
FROM YourTable

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

Subscribe to my blog
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-24 : 13:41:52
or

SELECT floor(YourColumn)
FROM YourTable


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -