Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add double quote (i.e. ") in a string

Status
Not open for further replies.

Doraemon

IS-IT--Management
Sep 12, 2003
31
HK
I would like to ask is it possible to add double quote in a string.

Since when assigning value to a string variable, we have to use double quote to quote the text, so I wonder a double quote can be included in the text, so that double quote can be displayed.

Thank for your help in advance.
 
try adding
Code:
 & Chr$(34) &
where you want the double quote to appear

Redapples

Want the best answers? See FAQ181-2886

 
Just use double double quotes ("") everywhere you want a single double quote, for instance:

If you want to produce a SQL string that looks like this:
SELECT * FROM mytable WHERE LastName="smith";

Then the code might look like:
strSQL = "SELECT * FROM mytable WHERE LastName=""smith"";"

or you might do something like this:
strFilter = 'smith'
strSQL = "SELECT * FROM mytable WHERE LastName=""" & strFilter & """;"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top