• if you want the result like this

    TranIDCode

    201205AMDDOH

    201206IXJRMI

    then the query should be

    select TranID , OriginCode + DestinationCode 'Code' from #Test

    if this is not as per your output post a detailed explaination.

    Regards
    Durai Nagarajan