Board index » delphi » Single Parenthesis inside string

Single Parenthesis inside string

I'm trying to build a query at runtime using SQL.Add statements
to add some string literals concatenated with some string
variables.  The problem is that I need to enclose part of
the statement in parentheses to handle AND and OR statements
properly, so some of the strings must have a single parenthesis
in the middle.  The compiler won't allow this.  I know that
inside a string you must use two apostrophes together in order
to use one apostrophe (for contractions, etc.).  But what do
you do to get that left or right parenthesis in the middle of
a string?
--
============================================================
Rick Carter   carte...@email.uc.edu   rcar...@tso.cin.ix.net
============================================================

 

Re:Single Parenthesis inside string


Quote
Richard Carter wrote in message <6d80oh$ma...@news.ececs.uc.edu>...
>I'm trying to build a query at runtime using SQL.Add statements
>to add some string literals concatenated with some string
>variables.  The problem is that I need to enclose part of
>the statement in parentheses to handle AND and OR statements
>properly, so some of the strings must have a single parenthesis
>in the middle.  The compiler won't allow this.  I know that
>inside a string you must use two apostrophes together in order
>to use one apostrophe (for contractions, etc.).  But what do
>you do to get that left or right parenthesis in the middle of
>a string?

strvar1+'('+strvar2

Is that what you mean?

        -- Kirk

Other Threads