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.
| Author |
Topic |
|
Trudye
Posting Yak Master
169 Posts |
Posted - 2008-06-17 : 07:32:43
|
| I'm having a problem creating a isnull statement.I want to do two things I want to list all of the accounts that have a null value in a numeric field. And I want to update those accounts to 0.00.I tried:select Account_Num, isnull(TotalDDMFEE, 0)FROM Addr_20080402But it returned all recordsFor the update I tried:update Addr_20080402CASEwhen TotalDDMFEE = ' ' then TotalDDMFEE = 0.00ANDupdate Addr_20080402CASEwhen TotalDDMFEE = isnull(TotalDDMFEE, 0) then TotalDDMFEE = 0.00Any ideas how I should have written these two queries?Thanx,Trudye |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-06-17 : 07:45:26
|
| Just add:where TotalDDMFEE is null to your query. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-17 : 07:46:08
|
| [code]1.select Account_Num, TotalDDMFEEFROM Addr_20080402WHERE TotalDDMFEE IS NULL2.update Addr_20080402set TotalDDMFEE =0.00WHERE TotalDDMFEE IS NULLOR TotalDDMFEE =' '[/code] |
 |
|
|
Trudye
Posting Yak Master
169 Posts |
Posted - 2008-06-17 : 08:38:07
|
| And the hits just keep on coming! It seems I tried to make that more complicated than it was.Thanks much,visakh16 |
 |
|
|
|
|
|