• You don't need the RTRIM at all. Here's an example.

    WITH Customer(Source) AS(

    SELECT 'CREDITNEW' UNION ALL

    SELECT 'CREDITNEW ' UNION ALL --Spaces added

    SELECT 'CREDITNEW' UNION ALL --Tab added

    SELECT 'CREDITOLD' UNION ALL

    SELECT 'TOC')

    SELECT * ,

    CASE

    WHEN RTRIM(Customer.Source) IN ('CREDITNEW','CREDITOLD','TOC') THEN 'CREDIT'

    WHEN RTRIM(Customer.Source) IN ('DEBIT') THEN 'UC DEBIT'

    WHEN RTRIM(Customer.Source) IN ('DEBITOLD','DEBITNEW','TLC') THEN 'DEBIT' -- Defined orginally with space, Crystal uses the space version for logo

    ELSE 'UNDEFINED' -- Default logo

    END AS CompanyName,

    CASE

    WHEN Customer.Source IN ('CREDITNEW','CREDITOLD','TOC') THEN 'CREDIT'

    WHEN Customer.Source IN ('DEBIT') THEN 'UC DEBIT'

    WHEN Customer.Source IN ('DEBITOLD','DEBITNEW','TLC') THEN 'DEBIT' -- Defined orginally with space, Crystal uses the space version for logo

    ELSE 'UNDEFINED' -- Default logo

    END AS CompanyName

    FROM Customer

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2