View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hall Hall is offline
external usenet poster
 
Posts: 9
Default Variable names in SQL

My VBA code has an SQL statement to call. I'm assigning the statement to a
string variable and use this variable to call it later. The statement has a
condition (the "where" clause) that needs to compare a column name to
another variable's value.

What is the syntax for this? For example:

testvalue="boo"
sqlstring="select * from mytable where mycolumn=testvalue"

How do I mark testvalue in the select string?