Saturday, October 13, 2007

SRS Switch versus Iif

How do you like the Iif statement equivalent of the Switch statement in the previous post? :-)

=IIF(Fields!Stops.Value = 0, "",
(IIF(Fields!Stops.Value = 1, Fields!ScheduleJourneyCityPairs.Value.Substring(4, 3),
(IIF(Fields!Stops.Value = 2, Fields!ScheduleJourneyCityPairs.Value.Substring(4, 3) & " " &
Fields!ScheduleJourneyCityPairs.Value.Substring(12, 3),
Fields!ScheduleJourneyCityPairs.Value.Substring(4, 3) & " " &
Fields!ScheduleJourneyCityPairs.Value.Substring(12, 3) & " " &
Fields!ScheduleJourneyCityPairs.Value.Substring(20, 3))))))

No comments: