troubleshooting Question

Can I write this in an expression or is there a better way in custom code?

Avatar of rhservan
rhservanFlag for United States of America asked on
Microsoft SQL ServerMicrosoft DevelopmentSSRS
6 Comments2 Solutions407 ViewsLast Modified:
Let me know if you need additional clarity to my question!

Current: This works as needed.

=Right(Fields!REASONB.Value,Len(Fields!REASONB.Value) - InStrRev(Fields!REASONB.Value,"-"))

This expression removes all characters from first instance of  '-', located from the right end of string, to the beginning of the string.

Example:

When expression runs on data below

ReasonB
SMPLT - QSY - Error 1234

Returns

ReasonB
Error 1234
----------------------------------------------------------------------------------------------------------------------------
Desired:

In addition to the above expression I would like to COMPARE Fields!REASONB.Value with Fields!REASONA.Value

For an example:

If Fields!REASONB = Fields!REASONA Make ReasonB column blank.

ReasonA                                                 ReasonB
SMPLT - QSY - Error 1234                               SMPLT - QSY - Error 1234

Returns

ReasonA                                                 ReasonB
SMPLT - QSY - Error 1234                              

OR

If Fields!REASONB <> Fields!REASONA Return Maintain what is already in Fields!REASONB

ReasonA                                                 ReasonB
SMPLT - QSY - Error 1234                               Flooding

Returns

ReasonA                                                 ReasonB
SMPLT - QSY - Error 1234                               Flooding
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros