• There are a couple of possible issues, have you tried just putting one of those fields into a variable and passing it through the Splitter

    I did a simple test using my version of Jeff's splitter (without the ItemNumber) on one of the strings and it worked.

    DECLARE @test-2 VARCHAR(8000)='01ªCO-RKªMrªRªKeastªªª1ª1ª1ª1ª1ª1ª0ªICTª0ªRyanªªª0ª0ª0ªª0ªªªªªICT Systems Analyst 2ª0ª0ª0ª0.00ªªªª660ª660ª0ª27/02/2015ªJB7ª12/08/2014ª14:37:18ª0ª'

    SELECT * FROM Reporting.SplitParam_test(@Test,'ª') WHERE ItemNumber=17

    Returns the result Ryan

    Also wouldn't it be better to do something like this rather than have all the cross applys

    DECLARE @test-2 VARCHAR(8000)='01ªCO-RKªMrªRªKeastªªª1ª1ª1ª1ª1ª1ª0ªICTª0ªRyanªªª0ª0ª0ªª0ªªªªªICT Systems Analyst 2ª0ª0ª0ª0.00ªªªª660ª660ª0ª27/02/2015ªJB7ª12/08/2014ª14:37:18ª0ª'

    SELECT PvtData.*

    FROM

    (

    SELECT

    CASE ItemNumber

    WHEN 5 THEN 'Surname'

    WHEN 17 THEN 'ForeName'

    WHEN 15 THEN 'JobTitle'

    END ItemDesc

    ,Item

    FROM Reporting.SplitParam_test(@Test,'ª')

    WHERE ItemNumber in (5,15,17)

    ) rawdata

    PIVOT

    (

    MAX(Item) FOR ItemDesc IN ([Surname],[ForeName],[JobTitle])

    ) PvtData

    I also cant see the point of the Cross apply on the bi/ai columns unless you want one row PER element in each, again there are simpler ways to do that.

    If you wanted to be really clever, you simply create a mapping table that has the element Id and a description, that way a simple join from ItemNumber to the table and you can do away with the case statement. eg

    DECLARE @test-2 VARCHAR(8000)='01ªCO-RKªMrªRªKeastªªª1ª1ª1ª1ª1ª1ª0ªICTª0ªRyanªªª0ª0ª0ªª0ªªªªªICT Systems Analyst 2ª0ª0ª0ª0.00ªªªª660ª660ª0ª27/02/2015ªJB7ª12/08/2014ª14:37:18ª0ª'

    DECLARE @LkpTable TABLE

    (

    ElementNumber smallint

    ,ElementDesc varchar(100)

    )

    INSERT INTO @LkpTable

    VALUES

    (5,'Surname')

    ,(17,'ForeName')

    ,(15,'JobTitle')

    SELECT PvtData.*

    FROM

    (

    SELECT

    ElementDesc

    ,Item

    FROM Reporting.SplitParam_test(@Test,'ª')

    JOIN @LkpTable ON ElementNumber=ItemNumber

    ) rawdata

    PIVOT

    (

    MAX(Item) FOR ElementDesc IN ([Surname],[ForeName],[JobTitle])

    ) PvtData

    This way you can control things a lot smoother.

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices