PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Problem with apostrophe
Problem with apostrophe
Iniciado por guest, 24,sep. 2015 00:52 - 3 respuestas
Publicado el 24,septiembre 2015 - 00:52
I have a line of code:

FOR EACH gpsdContact WHERE "sFirstName ~= ' "+EDT_FirstName+" ' AND sLastName ~= ' "+EDT_LastName+" ' "

Thank won't work if the name has an apostrophe in it like O'Brien. How do I fix this?
Publicado el 24,septiembre 2015 - 09:13
Hey Joel,

FOR EACH gpsdContact WHERE "sFirstName ~= ' "+Replace(EDT_FirstName,"'","''")+" ' AND sLastName ~= ' "+Replace(EDT_LastName,"'","''")+" ' "

Ciao,

Peter H.
Publicado el 24,septiembre 2015 - 10:32
you must escape the apostrophe with a backslash, check this help page in the section Filter (syntaxes 2)

http://doc.windev.com/en-US/…
Publicado el 24,septiembre 2015 - 11:35
Hi Paulo,

The escaping example you refer to concerns WLanguage filtering.

I thought Joel is using SQL but was too fast.
In SQL you just double the single quote to escape it, in WLanguage you indeed escape it...

Cheers,

Peter H.