PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → for all question
for all question
Débuté par Allard, 15 jan. 2018 09:39 - 1 réponse
Posté le 15 janvier 2018 - 09:39
|Hi

I have a for all loop with a condition. I want to add a condition.


The condition nees to be a search

exampl
for all people where people.existing = true
looperaddline(...
end

exampl
for all people where "people.existing = true AND people.name LIKe edt_search"
looperaddline(...
end

But the like does not work. I donnot get the help it states to use a [ but that doesnot work

Please help

Regards

Allard
Posté le 15 janvier 2018 - 12:18
Hi Allard,

Use HExecuteSQLQuery: more easier and more faster:

MyQuery is Data Source
// Initializes the query
IF NOT HExecuteSQLQuery(MyQuery, ...
"SELECT * from people where existing='"+"true"+"' AND name LIKE '"+EDT_SEARCH+"'") THEN
Error("Error while initializing the query" + CR + HErrorInfo())
RETURN
END

// Read the first record of the query
HReadFirst(MyQuery)
WHILE NOT HOut()
LOOPERADDLINE....
HReadNext()
END