Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2009
    Posts
    6

    Unanswered: Error on case query

    I'm getting an error while trying to execute the following statement. What's wrong with it?

    "Select * from master where case(isnull(firstname) when 1 then '' else firstname end +' '+ case(isnull(lastname) when 1 then '' else lastname end like '%" & Text1.Text & "%'"

  2. #2
    Join Date
    Aug 2005
    Posts
    30
    Try using "CONCAT" for joining your case results instead of "+"

    "Select * from master where CONCAT(case(isnull(firstname) when 1 then '' else firstname end ,' ', case(isnull(lastname) when 1 then '' else lastname end) like '%" & Text1.Text & "%'"

    If even then not getting success show what exact error is occurring.

  3. #3
    Join Date
    Apr 2009
    Posts
    6
    that worked..thnx

Posting Permissions

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