Page 1 of 1

DatabaseManager - SQL - Matching with LIKE not working

Posted: Thu Apr 22, 2004 7:59 am
by GaryFanning
I am very new to PC, using PCP8.5, but have a few years working with SQL based databases. We made some rush decisions in importing data and then creating family units; husband and wife not being in the right order (number 1 or 2) and much more.

We want to remove all conventional titles; Mr., Mrs., Miss. seen in the "mailing name" of the "maintain family mailing list" screen.

When I attempt to SQL SELECT only rows with WHERE LIKE "Mr%" the system returns zero rows. In fact, playing around I see that using the SQL LIKE and more than one character returns zero rows each time, yet if I search for "M%" the system returns all rows correctly; all beginning with the character "M".

Here is an example of my query:

select * from MA where NAMELINE like 'mr%'

I've tested against another table/column (faaccts/desc) and the LIKE works.

So now I'm believing it must be something to do with the column "nameline" and wondering if it some type of view, etc.

Thanks,

Gary

Posted: Thu Apr 22, 2004 11:27 am
by Zoe
Try this.

SELECT * FROM MA WHERE UPPER(NAMELINE) LIKE "MR%"

The database manager will read that command in all uppercase, so use the upper() to make the nameline uppercase as well.