Rabu, 12 April 2017

[MS_AccessPros] Apostrophe in Variable

 

I'm having a problem with the syntax for passing a variable whose definition contains an apostrophe to a SQL statement. I can never seem to get the punctuation right.


This doesn't work what I tried passing the name WITH the variable in code:

SELECT Part FROM tblPart INNER JOIN tblPartSupplier ON tblPart.Part = tblPartSupplier.Part WHERE (((tblPartSupplier.Supplier)= '" & varSupplier & "'" & ")"


It translates to:

SELECT Part FROM tblPart INNER JOIN tblPartSupplier ON tblPart.Part = tblPartSupplier.Part WHERE (((tblPartSupplier.Supplier)= 'Plumber's Supply')


What I need to end up with is double quotes around the supplier name: ("Plumber's Supply")


Can anyone point me in the right direction?


__._,_.___

Posted by: paco6945@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar