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)
 Sql Problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-03-20 : 09:52:08
Deepali writes "I want to put decimal number up to 4 precision like 0.0234 but in Sql it converts to 0 or say if I put 4.0456 to 4. I have taken data type as decimal and precision as 4. Pls let me know where I am doing wrong."

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2007-03-20 : 10:03:08
Declare @f float , @d Decimal(6,4)
Select @f = 0.0234 , @d = 0.0234
Select @f,@d

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-03-20 : 10:03:41
create table #x (i decimal(18,4))
insert #x select 4.0456
select * from #x
drop table #x


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -