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

DoCmd.RunSQL where SQL has "/" in the string

Status
Not open for further replies.

jaaret

Instructor
Jun 19, 2002
171
I've written a Delete Query that deletes records from a linked table named Neighbor where the string field DocDate has zeroes for days, such as "05/00/1999"
The Delete Query works but when I try to use the SQL code in a RunSQL statement (below) the forward slash characters cause an error. What is the work around for this?

'Delete records from the linked Neighbor table with
'days denoted with zeroes
DoCmd.RunSQL "DELETE NEIGHBOR.DOCDATE FROM NEIGHBOR _
WHERE (((NEIGHBOR.DOCDATE) Like "*/00/*"));"

Thanks!
Darrell
 
I think if you use single ticks in the LIKE that it will work:

DoCmd.RunSQL "DELETE NEIGHBOR.DOCDATE FROM NEIGHBOR _
WHERE (((NEIGHBOR.DOCDATE) Like '*/00/*'));"

Leslie
 
I would think the double quotes withing the string would cause the first problems, could you try using single quotes, just:

DoCmd.RunSQL "DELETE NEIGHBOR.DOCDATE FROM NEIGHBOR " & _
"WHERE (((NEIGHBOR.DOCDATE) Like '*/00/*'));"

Roy-Vidar
 
I'm amazed at the speediness! Thank you both!

Darrell in beautiful, hazy Seattle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top