>Hello,
>I'm using a variable in the WHERE clause of a SQL Statement. The variable looks like so:
>cMyVar = "ALLTRIM(MyTable.MyField) = '" + ALLTRIM(THIS.VALUE) + "'"
>
>Naturally, if MyTable.MyField contains an apostroph (like "De'Isle"), I get a syntax error :-(
>What do I have to do in this case?
>Thanks in advance for your help!
You may switch apsotroph and quotes:
cMyVar = 'ALLTRIM(MyTable.MyField) = "' + ALLTRIM(THIS.VALUE) + '"'
If it's not sufficient, you may use CHRTRAN() to get rid of apostrophes.
Edward Pikman
Independent Consultant