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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a quote character

Status
Not open for further replies.

japkin

Programmer
Jul 14, 2004
1
US
I am trying to do something quite simple, but I cannot get it to work. I just want to print out a command containing a single quotation mark, and I've been unable to find anywhere on the web that says how to do this. Books have been no help, either!

This is an example of what I am trying to do:

PRINT 'SET STATE = 'Pending', DATE = GetDate()'

This, of course, doesn't work because the second quote ends the PRINT statement. I tried using backslashes to quote it to no avail.

I'm sure it's easy to do. I just couldn't find it anywhere! Any help is appreciated. Thanks!
 
Try doubling inner quotes:
Code:
PRINT 'SET STATE = [b]''[/b]Pending[b]''[/b], DATE = GetDate()'
 
You may also try this:
PRINT "SET STATE = 'Pending', DATE = GetDate()"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top