Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WHERE field1 + field2 + field3 = myvalue
Message
De
15/08/2006 10:01:10
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01145445
Message ID:
01145569
Vues:
24
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"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform