2012-06-25 22 views
0

您好我呼籲參數 'SiteOfClinic',其中列出下來幾個網站在報告服務相結合的參數值2008

  1. 喔YAC
  2. DHH Paeds
  3. QHH YAC
  4. TRP Paeds
  5. MJH Paeds

它迄今爲止工作正常,但現在我想com將前兩名選項(選項1和選項2)合併在一起,因此我創建了另一個標籤'OHH YAC/DHH Paeds',但我不知道要在表達中加入哪兩個。

我曾嘗試以下,但unsuccessfull

=SPLIT(JOIN(Parameters!HospitalSite.Value,"'OHH YAC,DHH Paeds"),"'OHH YAC,DHH Paeds") 

=JOIN(Parameters!HospitalSite.Value,"OHH YAC,DHH Paeds") 

請幫助,非常感謝。

回答

0
>> ' Assuming "SiteOfClinic" (aka "Parameters!HospitalSite.Value") 
>> ' is an array containing 3 string values: 
>> SiteOfClinic = Array("A 0", "B 1", "C 2") 
>> ' and you want an array holding the first two items, you have to create a copy: 
>> Copy = SiteOfClinic 
>> ' and keep just the first two items 
>> ReDim Preserve Copy(1) 
>> ' Use Join(array, separator) to build a string from Copy 
>> s = Join(Copy, "<>") 
>> WScript.Echo s 
>> or Split(string, separator) to get an array from s 
>> a = Split(s, "<>") 
>> WScript.Echo CStr(UBound(Copy)=UBound(a)), CStr(a(0)=Copy(0)) 
>> 
A 0<>B 1 
True True