KB-30218: LIKE clause not working on a Query

Question:

Why is a Query’s filter using the LIKE clause not working when typing just a part of the word to be filtered? For example, when typing “tag”, only the word “tag” is displayed, but tag001, tag002, etc., are not displayed.

Solution:

To check every message which has a certain word, you must place it between two percent signs ( % ). For example, on a Query where the variable’s name is var, and Text1 is the Display where the word to be filtered was inserted, you must write the following:

filtervar = “%” & Screen.Item(“Text1”).Value & “%”
set query = Screen.Item(“E3Browser1”).Item(“Query1”)
query.SetVariableValue “var”, filtervar

Below, you can see the available filters for the Query:

  • LIKE ‘A%’ All messages starting by A
  • LIKE ‘%A%’ All messages containing A
  • LIKE ‘_NG’ All messages starting with any character followed by NG
  • LIKE ‘[AF]%’ All messages starting by A or F
  • LIKE ‘[A-F]%’ All messages starting by any letter between A and F
  • LIKE ‘[A^B]%’ All messages starting by A where the second character is not B
Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *