Trey, you sent me this reply to my question regaurding RTRIM and LTRIM.
Why do you wrap it rtrim or ltrim?
if you look for 'Smith' in a column it's should just find the rows that have 'Smith' as the value of that column - not e.g., 'Smithy' or 'Smithereen'.
or are you concatenating? if so, separate the concatenation into individual expressions. "compound" indexes in SQL Server are really covered, not concatenated like in VFP.
e.g., VFP:
use people
index on clastname+cfirstname tag fullname
would be this in SQL Server create index fullname on people (clastname, cfirstname)
This is covered, meaning that you can use ...where clastname = 'Smith' and cfirstname = 'John'... instead of ...where rtrim(clastname)+rtrim(cfirstname)='SmithJohn'...
This is good if the field is left justified. What if the field is right justified and nuneric Ex: procid is " 76272" and you get a string such as "76272" If you do a select for procid = "76272" you will not get a return value because the Id in the table is padded with 2 spaces on the left. Wouldn't you need to trim the field in order to find this field.
Ex: where LTRIM(pracid) = varpracid.
Allso, what if the field data had spaces on the left and right EX:
" 76272 "
looking to hear from you soon!!!
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement