PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → WB19 - SQl question
WB19 - SQl question
Iniciado por guest, 30,jul. 2017 20:05 - 3 respuestas
Publicado el 30,julio 2017 - 20:05
Hi all - I've got a piece of SQl I can't get working -

sSQL is string = [
Select
*
FROM
gpsdContact
WHERE
sFirstName LIKE '%1'
AND
sLastName LIKE '%2'
AND
bDeleted = 0
]
sSQL = StringBuild(sSQL,EDT_FirstName,EDT_LastName)

At least this doesn't throw an error, but brings back an empty set. I want to find all names that start with whatever is in the edit fields. Any ideas?
Publicado el 30,julio 2017 - 20:26
Hi Joel,

the parameters should start with a % character, so try this:

sSQL is string = [
Select
*
FROM
gpsdContact
WHERE
sFirstName LIKE '%%1'
AND
sLastName LIKE '%%2'
AND
bDeleted = 0
]
sSQL = StringBuild(sSQL,EDT_FirstName,EDT_LastName)
Publicado el 30,julio 2017 - 20:47
Hi Stefan -

Actually, after looking at something on the Internet about SQL, I tried putting a % at the end and it worked fine - I'll try your solution first -

Thanks!

J
Publicado el 30,julio 2017 - 21:48
Hi Joel,

you coult be right about that.