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)
 Help in finding Sign .

Author  Topic 

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2008-06-21 : 03:40:58
Hello,

Is there any built in function to find out the sign of a value.
For Ex: -225.89 Sign is -
566.987 Sign is +

Thanks
Ganesh Kumar

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

PeterNeo
Constraint Violating Yak Guru

357 Posts

Posted - 2008-06-21 : 04:24:39
read about SIGN() in BOL
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-21 : 14:06:56
or

select col,case when col<0 then -1 when col=0 then 0 else 1 end as sign from your_table

Madhivanan

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

- Advertisement -