| Subject |
Re: touppercase |
| From |
Helen Prior <web2@htsol.co.uk> |
| Date |
Fri, 07 Oct 2022 04:26:40 -0400 |
| Newsgroups |
dbase.getting-started |
Dear Mervyn
Thank you for the upper/lower - That partially works but fails if the first character is in upper and the rest of the search word is in lower.
Going back to touppercase
Will this command permanently lower case to upper case? - If so how might that be achieved?
That might hopefully be the answer - It is so frustrating that dbase/sql cannot search ignoring upper/lower case
Regards
Helen
Mervyn Bick Wrote:
> On 2022/10/05 08:30, Helen Prior wrote:
> > Hi
> > I am trying to do a 'like' search on a memo field - I now have it working thanks to Mervyn but it is case senstitive - Most of the text is lower case but names etc have the first letter in upper and so I want to ignor case - In the help files there is a command 'touppercase' which reading the text seem to do what I need but it is how to contruct the command is the problem.
> > OR is there a better way?
> > Could anyone help please?
> > Regards Helen
>
>
> toUppercase() is a method of a dBASE string object. Unfortunately it
> isn't applicable in a SELECT statement which requires localSQL
> functions. Fortunately localSQL includes UPPER() and LOWER() functions
> which can be used in a SELECT statement.
>
>
> Form.DAILYLOG2.sql = [select * from DAILYLOG where upper(Keyevent) like
> '%] + upper(Vkeyevent) + [%' or upper(History) like '%]
> +upper(Vkeyevent) + [%']
>
> Off at a tangent. :-)
>
> dBASE itself also includes the UPPER() and LOWER() functions so the
> following are equivalent.
>
> cVar = form.query1.rowset.fields['lastName'].value.toUpperCase()
> cVar = upper(form.query1.rowset.fields['lastName'].value)
>
> Both work but the first one is better Object Oriented Programming. The
> second option is more likely to be used by programmers who started using
> dBASE before OOP was introduced.
>
> The localSQL help file is
>
> C:\Program Files (x86)\Common Files\Borland\BDE\localsql.chm
>
>
> Mervyn.
>
|
|