Neil,
> Ufrag = '%'+UPPER(tcLastNameFragment)+'%' ;
> cnLEN = TRANSFORM(LEN(tcLastNameFragment));
> SUBY = " SUBSTR(UPPER(title),1," + cnLEN + ") like '" ;
LIKE %something% is not optimizeable.
LIKE something% is optimizeable using an index on lastname
>If I pass "GOR" to the method, the select statement will return 3 the following 3 names as it should:
>GORE
>GORIN
>GORY
>
>If I pass in "T" to the method, every name that starts with "T" is found.
>Select statement works but lacks opitimization.
If you really only want names that start with the fragment
uFrag = upper( alltrim( tcLastNameFragment ) )
[where upper(lastname) = '] + uFrag + [']
should work for you.