What Character?

  • Thread starter Thread starter Mr. JYC
  • Start date Start date
M

Mr. JYC

Hello,

When I am generating a SQL statement to be used in programming, what
character should I use for " for instance,

select stores from mall where stores like "Sears*";

I am trying to build a string from the above statement but I don't know what
to use for the " character.

So, the statement would look like

str = "select stores from mall where stores like" & Sears*

but I am stuck with what to use for what to put around Sears* so that the
SQL statement would execute properly.

Please help.
 
"SELECT stores FROM mall WHERE stores LIKE 'Sears*'"

if you're referring to a control on a form, rather than a hard-coded value,
the syntax would be

"SELECT stores FROM mall WHERE stores LIKE '" _
& Me!ControlName & "*'"

hth
 
Back
Top