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 2008 Forums
 Transact-SQL (2008)
 Replacing Null Values with 0

Author  Topic 

JohnMcLaughlin
Starting Member

28 Posts

Posted - 2011-04-04 : 11:02:50
I am currently trying to minus Column B values from Column A. Some values is B are NULL. and the result is coming up as NULL. How can i replace NULL values with 0.

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-04-04 : 11:07:31
Use ISNULL() or COALESCE() function.

SELECT isNull(a, 0) - isNull(b, 0)
Go to Top of Page

JohnMcLaughlin
Starting Member

28 Posts

Posted - 2011-04-04 : 11:19:37
Worked!!! Thank you
Go to Top of Page
   

- Advertisement -