Forum Moderators: coopster

Message Too Old, No Replies

LIKE not working?

         

askeli

10:39 pm on Aug 18, 2005 (gmt 0)

10+ Year Member



Anyone help, im having problems with a LIKE it simply returns no results on 'a%' searches when the results are there.

example:

SELECT * FROM table WHERE field LIKE 'a%' Returns 0 <==
SELECT * FROM table WHERE field LIKE '%a%' Returns 1
SELECT * FROM table WHERE field LIKE '%a' Returns 1

field = aba

im not sure if its to do with collation,

thanks

ChadSEO

10:48 pm on Aug 18, 2005 (gmt 0)

10+ Year Member



askeli,

As far as I can tell, that should be working. My only thought is maybe there is some sort of hidden character at the beginning. If you do a "select length(field) from table;" what length does it return? Beyond that, I'm not sure.

Chad

askeli

11:30 pm on Aug 18, 2005 (gmt 0)

10+ Year Member



Tried it, nothing there.

Anyway i played around and found it was only that field the problem lies on, tried recreating the table, same problem, i copied it to a new database and still wouldnt work. so i tried creating a fresh table on a new database and it works ok now?

Strange! thanks for your help, ive kept the old database and will dig deeper tomorrow and try to find whats causing it.

Thanks