bradyboyy88
Well-known Member
- Joined
- Feb 25, 2015
- Messages
- 562
Imagine I have a query saved in a string variable that is passed to an Connection.Open command via ado. The problem I am having is that I dont know how to get to use double quotes in my sql code in my excel vba code.
An example is as follows:
This draws an error. I tried to double up my quotes as follows but still draws an error.
An example is as follows:
Code:
SqlQuery="Select Table1.STATE_ABREVIATION & "-" & Format(Table1.IDS,"00000000")) AS IDS_for_Display From Table1"
This draws an error. I tried to double up my quotes as follows but still draws an error.
Code:
SqlQuery="Select Table1.STATE_ABREVIATION & ""-"" & Format(Table1.IDS,""00000000"")) AS IDS_for_Display From Table1"
Last edited: