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.
Author |
Topic |
kdnichols
Posting Yak Master
232 Posts |
Posted - 2007-01-03 : 08:19:00
|
Hello,I have the following expression.[code]="BY " & UCase(Parameters!SummaryBy.Value & IIf(Parameters!SummaryBy2.Value <> "", " " & Parameters!SummaryBy2.Value, "") & IIf( Parameters!SummaryBy3.Value <> "", " " & Parameters!SummaryBy3.Value, ""))[/code[]How do I add a slash betwen each word, but also to take into consideration that one, two, or three parameters may be chosen?Thanks IN Advance.Trying to start the New Year off right on the acronyms Peso!! Kurt |
|
JoeNak
Constraint Violating Yak Guru
292 Posts |
Posted - 2007-01-03 : 09:37:35
|
I think this should do it.="BY " & UCase(IIF(Parameters!SummaryBy.Value <> "", Parameters!SummaryBy.Value & " / ", "") &IIF(Parameters!SummaryBy2.Value <> "", Parameters!SummaryBy2.Value & " / ", "") & IIF(Parameters!SummaryBy3.Value <> "", Parameters!SummaryBy3.Value, "")) |
|
|
kdnichols
Posting Yak Master
232 Posts |
Posted - 2007-01-03 : 09:41:55
|
Hello Joe,That is almost it however if I have two Parameters it still shows an extra / at the end lets say I have Source Group and LO it now showsSource / Group /Can you fix that part for me?Thanks almost there!Kurt |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-03 : 11:02:29
|
[code]= "BY " & UCase(IIf(Parameters!SummaryBy.Value = "", "", Parameters!SummaryBy.Value) &IIf(Parameters!SummaryBy2.Value = "", "", IIf(Parameters!SummaryBy.Value = "", Parameters!SummaryBy2.Value, " / " & Parameters!SummaryBy2.Value)) & IIf(Parameters!SummaryBy3.Value = "", "", IIf(Parameters!SummaryBy.Value = "" And Parameters!SummaryBy2.Value = "", Parameters!SummaryBy3.Value, " / " & Parameters!SummaryBy3.Value)))[/code]Peter LarssonHelsingborg, Sweden |
|
|
kdnichols
Posting Yak Master
232 Posts |
Posted - 2007-01-03 : 16:13:07
|
Hello Peso,Thanks! This works perfectly!You are great!Have a great day!Kurt |
|
|
|
|
|
|
|