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 |
bubberz
Constraint Violating Yak Guru
289 Posts |
Posted - 2005-07-27 : 16:13:23
|
Anyone have an example on how to write an IF Then ElseIF statement?I can't get the syntax.Thanks! |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-07-27 : 16:20:33
|
You'll need to use IIf if this is in an expression in Reporting Services. If you are writing it in the custom code section, then the syntax is VB.NET syntax.Tara |
 |
|
jhermiz
3564 Posts |
Posted - 2005-07-27 : 18:18:10
|
[rs expression syntax]=IIF(Parameters!MyParam.Value = "blah", 1, 0)[/rs expression syntax]If the condition is true it returns 1 else 0, if you need multiple iif's just nest them:=IIF(Condition, 1, IIF(Condition, 1, 0))[vb.net syntax]If Condition Then'do somethingelse'do something elseend if[/vb.net syntax]If you need multiple else's:If Condition then'do somethingelseif Condition then'do something elseelseend ifJon Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]Imperfection living for perfection -- [url]http://jhermiz.blogspot.com/[/url] |
 |
|
bubberz
Constraint Violating Yak Guru
289 Posts |
Posted - 2005-07-27 : 18:30:16
|
Thanks to both of you!I think I'm going to need to write the code in the Code section.How do I call that code in an expression?Thanks! |
 |
|
|
|
|