Autocomplete convert to Upper Case
I've got a query running in an autocomplete box that is hitting a field in a fGDB. But because the field it's querying is in upper case, it requires the user to type in caps to get it to populate.
To make it more user-friendly, is there any simple way to take the input string and make it upper case?
Thanks.
-
It depends on the format of the where clause for the autocomplete. I think for most cases where clauses are similar to "fieldname LIKE '{0%}'" where {0} stands in for the value the user enters with a trailing wildcard. To make a case insensitive query you can use the standard syntax of the database, so for SQL Server and, I believe file geodatabases, you could use a where clause like "UPPER(fieldname) LIKE UPPER('{0}%'); this will convert both the value from the database and the value the user entered to uppercase and then compare them.
0 -
Brilliant Nicholas.
I was halfway there, but didn't have enough "UPPER's". Was becoming a bit of a downer, tbh... :)
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare