Hi Users,
I am performing Query task .
function execute(searchText, AssetSelected, SearchField) {
query.where = SearchField + " LIKE('" + searchText + "%')";
queryTaskQS.execute(query, showResultidentify);
}
I am passing all the query as SAMPLE(uppercase) but we do have some values which are not in uppercase
like "Sample", "SAmple","sample". In these cases the query is failing for me.
Is there any way where like operator wil work for all values "SAMPLE", "SAmple" ,"Sample" and "sample".
Thanks in advance
Regards
Aditya Kumar
Solved! Go to Solution.
Aditya,
To make a case insensitive search you use a SQL string like this:
query.where = "Upper(" + SearchField + ") LIKE Upper('" + searchText + "%')";
Aditya,
To make a case insensitive search you use a SQL string like this:
query.where = "Upper(" + SearchField + ") LIKE Upper('" + searchText + "%')";
Thanks Robert, It worked fine.