Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expressions syntax? 2

Status
Not open for further replies.

Catadmin

Programmer
Oct 26, 2001
3,097
US
Does anyone know if you can use a CASE statement in an Expression on Reporting Services? If so, what language should I be using? VB .Net, VB Script, VB 6.0??

If not, is there another option? I've got seven nested IIF statements which returns correctly on the first item, but then returns my innermost "OTHER" result on all other items.

Thanks,



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Don't think you can use it in an expression (quite happy to be proved wrong) but certainly can use it in the report code which can then be used in the expression

=code.FunctionName(Any_Parameters)

I have used this quite a bit for this kind of thing...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
I've also tried using the case statement in an expression but unsuccessfully. The only way round it that I have found is by using nested IIF statements.

Thanks

Adam Blackwell
Information Analyst
 
You could use the switch function

e.g. Switch("check1","output1","check2","output2")

equates to

If "check1" Then
"output1"
Else
If "check2" Then
"output2"
End If
End If
 
AHA! This is the first time I've heard of Switch. I'll have to try it. Thanks, paulkeys!



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top