OK, a valid address is:
5614 HIGH POINT RD
This works:
declare @cvalue varchar(15)
set @cvalue = '5614'
select * from occ_main where ltrim(rtrim(number))+ltrim(rtrim(st_prefix))+ltrim(rtrim(street))+ltrim
(rtrim(st_type))+ltrim(rtrim(st_suffix))+Ltrim(rtrim(apt_room)) LIKE '%' + ltrim(rtrim(@cvalue)) + '%'
and this works:
declare @cvalue varchar(15)
set @cvalue = 'HIGH'
select * from occ_main where ltrim(rtrim(number))+ltrim(rtrim(st_prefix))+ltrim(rtrim(street))+ltrim(rtrim(st_type))+ltrim(rtrim(st_suffix))+Ltrim(rtrim(apt_room)) LIKE '%' + ltrim(rtrim(@cvalue)) + '%'
and this works:
declare @cvalue varchar(15)
set @cvalue = '5614HIGH'
select * from occ_main where ltrim(rtrim(number))+ltrim(rtrim(st_prefix))+ltrim(rtrim(street))+ltrim(rtrim(st_type))+ltrim(rtrim(st_suffix))+Ltrim(rtrim(apt_room)) LIKE '%' + ltrim(rtrim(@cvalue)) + '%'
but this does not:declare @cvalue varchar(15)
set @cvalue = '5614 HIGH'
select * from occ_main where ltrim(rtrim(number))+ltrim(rtrim(st_prefix))+ltrim(rtrim(street))+ltrim(rtrim(st_type))+ltrim(rtrim(st_suffix))+Ltrim(rtrim(apt_room)) LIKE '%' + ltrim(rtrim(@cvalue)) + '%'
So I guess I have to remove ALL spaces in the value entered to pull matching records. Should've figured that...
(The code was cut from sql sever management studio - not vfp)
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"