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
 Transact-SQL (2000)
 select statement with if condition

Author  Topic 

jn-at-uk
Starting Member

20 Posts

Posted - 2005-04-20 : 11:11:45
I have a table with a field called result.
I want to check if result isnumeric then print the value of result
else if result is non-numeric the print '0.00'

Select result from table
sounds simple....but im gone blank for now

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-04-20 : 12:12:41
Try

SELECT CASE WHEN ISNUMERIC(YourColumn) = 1 THEN YourColumn ELSE '0.00' END AS Result
FROM ............

Andy

Beauty is in the eyes of the beerholder
Go to Top of Page

jn-at-uk
Starting Member

20 Posts

Posted - 2005-04-20 : 12:38:54
thanks.......worked
Go to Top of Page
   

- Advertisement -