Search on UPPER case

Posts   
 
    
JMichelson
User
Posts: 34
Joined: 27-Dec-2003
# Posted on: 20-Jan-2004 12:52:00   

Hello Frans.

I'd like to do a TypedList select on the upper case of the filter field. I'm using PredicateLike, but I don't know how to inform the function that I want to uppercase the field. I'd also like to sort on the uppercased sort field (using SortExpression), but I can't figure out how to do that either.

Thanks.

Jeff

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 20-Jan-2004 13:32:50   

If you install SqlServer using the case insensitive option (default), LIKE, ORDER BY etc. ignore casing. Therefore if you do SELECT * FROM Table WHERE Foo LIKE 'BL%', also 'blah' will match. You have to change the collation in Sqlserver 2000 of the column you want to use the case sensitive LIKE on. (and the ORDER BY). This doesn't work in SqlServer 7.

See: Google thread

Frans Bouma | Lead developer LLBLGen Pro