Jeff, your response is valuable to the original poster in that it gives him a straight-forward, scalable solution, but may be more valuable to me and others on SSC in that it demonstrates the practice of cutting to the core requirement. I had started with the question as posed -- how to parse the field with charindex() -- but the real problem was how to find fields with the first half the same as the second.
Somewhere on SSC a while ago, I saw the expression "You think you need an answer? No. You need a question." When stated "how to find first half equal to second half", the simpler and better solution almost writes itself. This is to say, the genius was in stating the problem accurately.
Let's make it work with address defined as a char(50) by using RTRIM() so that the RIGHT() function works as intended. Note that the LEN() function does an implied RTRIM already.--Declare @address table (address VARchar(50))
Declare @address table (address char(50))
insert into @address
select 'Lincoln'
union all
select 'Kentucky Kentucky'
union all
select 'Walla Walla'
union all
select 'New York New York'
union all
select 'New York CITY New York CITY'
union all
select 'Ohio'
union all
select 'Iowa'
SELECT
CASE
WHEN LEFT(Address,LEN(Address)/2)=RIGHT(rtrim(Address),LEN(rtrim(Address))/2)
--WHEN LEFT(Address,LEN(Address)/2)=RIGHT(Address,LEN(Address)/2)
THEN LEFT(Address,LEN(Address)/2)
ELSE Address
END
FROM @Address