Home Forums SQL Server 2008 SQL Server Newbies How to find postcodes with two spaces in the middle? RE: How to find postcodes with two spaces in the middle?
higgim
SSCarpal Tunnel
Points: 4090
More actions
July 8, 2016 at 9:57 am
#1889223
Would the code below work? Would capture anything with 2 or more spaces?
SELECT *
FROM dbo.Postcode AS p
WHERE LEN(RTRIM(p_code)) - LEN(REPLACE(RTRIM(p_code),' ', '')) >=2