Subject Re: touppercase
From Mervyn Bick <invalid@invalid.invalid>
Date Wed, 5 Oct 2022 10:51:08 +0200
Newsgroups dbase.getting-started

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