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 2000 Forums
 SQL Server Development (2000)
 Where Clause function of taking negative num out

Author  Topic 

werhardt
Constraint Violating Yak Guru

270 Posts

Posted - 2008-01-25 : 11:21:03
I have a query and I need to be able to take negative numbers out of it, example -16495.00. I am not sure how to add it to my where clause. I was going to put clm_tchg <> ‘-‘ I know that isn’t right, but I don’t know how to write it. Please help, Thanks.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-01-25 : 11:24:27
WHERE clm_tchg > 0 if its of int type

if varchar use,

WHERE CAST(clm_tchg AS int) <0 or
CHARINDEX('-',clm_tchg)=0
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-01-28 : 01:29:58
If it is of varchar then alter the column to proper decimal or float type

Madhivanan

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

- Advertisement -