Home > database >  Pb fuzzy query
Pb fuzzy query

Time:09-30

In the table is the following code to retrieve a bno this column=sle_1. The text of the statement

Bno dw_1. Setfilter (' a '+'='+ "' "+ sle_1. Text +" '")
Dw_1. Filter ()

But in order to realize the fuzzy retrieval, where should add
%?My usage of single and double quotes also not too clear, how to implement not

Similar code
If switch to other column, there is in Chinese, such as "title"
Even if I get the full name of the book, nor to retrieve the results

Ask and answer
Thank you ~

CodePudding user response:

The Number format
If the filter expression contains Numbers, the DataWindow expects the Numbers in U.S. format. The original concept in, be aware that the String function formats Numbers using the current system Settings. If you use it to build the filter expression, specify a display format that produces U.S. notation.
The Escape keyword
If you need to use the % or _ characters as part of the string, you can use the escape keyword to indicate that the character is part of the string. For example, the _ character in the following filter string is part of the string to be searched For, but is treated as a wildcard:

The comment LIKE ~ '% o_a15progress % ~'

The escape keyword designates any character as an escape character (do not use a character that is part of The string you want to match). In The following example, The asterisk (*) character is inserted before The _ character and designated as an escape character, so that The _ character is treated as part of The string to be matched:

The comment like ~ '% o * _a15progress % ~' escape ~ '* ~'

CodePudding user response:

Bno dw_1. Setfilter (' a '+'='+ "' "+ sle_1. Text + % '")

CodePudding user response:

Ha ha

CodePudding user response:

Bno dw_1. Setfilter (' a '+' like '+ "' "+ sle_1. Text +" % % '")

CodePudding user response:

Bno dw_1. Setfilter (' a '+' like '+ "' "+ sle_1. Text +" % % '")

CodePudding user response:

Thank you for the ls you
If I want to use the trim (sle_1. Text), change how to add
With dw_1. Setfilter (' bno '+' like '+ "" + sle_1. Text +"' % % '"), but there are content into Chinese characters out, don't quite understand why

CodePudding user response:

How can you not come
I can out dw_1. This was what setfilter (' bno '+' like '+ "' "+ sle_1. Text +" % % '")

CodePudding user response:

Bno in what type of database?
If it is a string type
Dw_1. Setfilter (bno "like" + "' % '+ trim (sle_1. Text) +" %' ")
Otherwise:
Dw_1. Setfilter (" string (bno) like "+" '%' + trim (sle_1. Text) + "% '")

CodePudding user response:

The
reference 7 floor quanhj response:
how can not to
I can out dw_1. This was what setfilter (' bno '+' like '+ "' "+ sle_1. Text +" % % '")


Err...
Out
I have a piece of code in front of the wrong
Sorry ah ~

CodePudding user response:

I still think the double quotes in the outer layer, single quotation marks in the layer, the code more readable
Dw_1. Setfilter (bno "like '% %'" + sle_1. Text + "")
Dw_1. Filter ()

CodePudding user response:

I always use a text box as the output results have a look at the inner value isn't up to par

CodePudding user response:

Ha ha ~ thank you very much to learn
  • Related