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
 Development Tools
 Reporting Services Development
 Like Expression for conditional expression?

Author  Topic 

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-05-20 : 15:12:30
Is it possible to have conditional expression that uses 'LIKE'.

Example:

=IIF(Fields!ID.Value LIKE "SP%", Fields!ID.Value, Fields!Parts.Value)

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-05-20 : 15:16:46
For this, just use the VB.NET Substring function.

Tara
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-05-20 : 15:38:38
Can this be done in conditional expression or do I have to do this in custom code section? Also how would this work if in conditional expression.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-05-20 : 15:42:15
Yes it can be done in a conditional expression. VB.NET functions can be called from there. Google VB.NET Substring to see examples of the function call.

Tara
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-05-20 : 15:53:25
Okay, got it now. It was pretty easy so if anyone needs it, here's an example. Will save you time looking all over for it.


=IIF(Fields!PART_ID.Value LIKE "PO:*", Fields!ID.Value, Fields!PART_ID.Value)
Go to Top of Page
   

- Advertisement -