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 |
|
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2012-04-15 : 22:14:20
|
| How to print the output if total amount is NULL, output should be 0.00Else those which has amount, output print the amount. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-04-15 : 22:35:17
|
[code]ISNULL ( <column> , 0)orCOALESCE ( <column> , 0)[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2012-04-15 : 22:47:08
|
| Thanks.I was thinking to use case when...This is more usefull.Thanks |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-04-15 : 23:05:35
|
you can also use CASE WHEN . . .CASE WHEN <column> IS NULL THEN 0 ELSE <column> END KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-04-16 : 12:12:26
|
quote: Originally posted by peace Thanks.I was thinking to use case when...This is more usefull.Thanks
COALESCE is equivalent to the CASE..WHEN internally------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|