FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Find words with query
Find words with query
Débuté par Michael Drechsel, 22 juil. 2008 15:11 - 3 réponses
Connectez-vous…
Michael Drechsel
#1
Posté le 22 juillet 2008 - 15:11
Hi,
I use HF SQL and Querys to find words in (memo) text fields.
If the string is "hello nice world" and the user type "nice world" the query finds the record.
I use a parameter with the "contains" option.
How can I build a query that find 2 or more words in the string, but not in order.
For example: "hello world" should find the record with "hello nice world".
greetings md
Signaler
0
0
Marc De Swert
#2
Posté le 22 juillet 2008 - 16:04
Hi md
use wildcart like this:
select field1, field2 from tablename where searchfield like '%hello%world%'
Marc. :xcool:
Signaler
0
0
DerekT
#3
Posté le 22 juillet 2008 - 16:24
Hi
First you will need to develop a way to separate the input string into separate words and also determine just how many words you will send to the query.
Using your example of two words......
In the query editor
For the field containing the text to be searched enter 2 parameters (all fields can accept multiple params, just select new a second time) as
MyDataString contains Param1
MyDataString contains Param2
Click on the 'Selection condition' button and select the option and select 'Existing conditions(AND/OR).
The sequence of condition filed will show 1 AND 2, change this to 1 OR 2
WD will validate the change.
Save the changes.
The underlying SQL code will look something like
SELECT
Customer.CustNum AS CustNum,
Customer.CustomerName AS CustomerName,
Customer.Company AS Company
FROM
Customer
WHERE
Customer.CustomerName LIKE %{Param1}%
OR Customer.CustomerName LIKE %{Param2}%
Many variations of selection criteria can be used with this method.
HTH
DerekT
Signaler
0
0
Michael Drechsel
#4
Posté le 22 juillet 2008 - 16:40
Hi Derek,
yes, I had the same idea now. I create a balloon tooltip in the entry section of the edit field with "Please insert a comma for multiple search words" and fill the parameters with the words.
thx
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte