Problem with "case" in an SQL query

Results 1 to 2 of 2

Thread: Problem with "case" in an SQL query

  1. #1
    jdawg187 Guest

    Default Problem with "case" in an SQL query

    I&#039ve created a search engine where users input text and insert it into the following SQL string:<BR><BR>SQLtemp="select * from t_Application where App_name"<BR>If myExactSearch="on" then<BR>SQLtemp=SQLtemp & " =&#039" & mySearch & "&#039"<BR>Else<BR>SQLtemp=SQLtemp & " LIKE &#039" & mySearch & "%&#039"<BR>End If<BR><BR>My problem is that the string is case-sensitive even with the LIKE command. Is there someway I can make the string case-insensitve. For instance, a user inputing word would turn up a record in the database Word despite the cap difference.<BR><BR>Thanks!!

  2. #2
    Jairo Guest

    Default RE: Problem with

    jdawg187,<BR>Try using a combination of the VBScript UCase function and the SQL Server Upper() function, and then do your comparison.<BR><BR>HTH,<BR>Jairo<BR>http://www.citywebarchitects.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •