1

I need to use the SSRS Switch function to fill background colour

=switch(Fields!Ref_No.Value="AAA","Green",Fields!Ref_No.Value= not like "AAA","RED"

How do I say if first 3 letters not like AAA then fill background Red?

Ian Preston
  • 38,816
  • 8
  • 95
  • 92
Nite Cat
  • 533
  • 2
  • 8
  • 12

1 Answers1

1

Just use Left and <>:

=Switch(Fields!Ref_No.Value="AAA", "Green"
  , Left(Fields!Ref_No.Value, 3) <> "AAA", "Red")

Left makes sure you're considering the first three characters only as per your requirement.

Ian Preston
  • 38,816
  • 8
  • 95
  • 92