Home Forums SQL Server 2005 T-SQL (SS2K5) Variable field length join RE: Variable field length join
Ken McKelvey
SSCoach
Points: 18755
More actions
February 21, 2011 at 4:55 am
#1289361
-- either (LEN ignores trailing spaces)
LEFT(vm.VCTCollectZipcodeId, LEN(vhml.ZipcodeFrom)) = vhml.ZipcodeFrom
-- or
vm.VCTCollectZipcodeId LIKE vhml.ZipcodeFrom + '%'