How do you write a sql statement on multiple lines? The _ continuer doesn't seem to work for them.
Many Thanks
Printable View
How do you write a sql statement on multiple lines? The _ continuer doesn't seem to work for them.
Many Thanks
in what?
Dim SQL As String
SQL = "SELECT yada FROM yada "
SQL = SQL & " WHERE yabba = 'dabba'
SQL = SQL & " AND ......
etc.
sSQL = "Select *"
ssql = ssql & " From Table"
I saw chrisjk comment after I posted mine.
My suggestion implies the creation of a string which is executed in VB via the .Execute method of whatever type of environment you are using, i.e., ADO, DAO
That's what I needed to know. Thanks!
VB Code:
strSQL = "SELECT one, two, three " & _ "FROM table1 " & _ "WHERE one = 1"
that'll do it
Try this:
sSQL = "SELECT * FROM " & _
"TableName WHERE " & _
"Blah blah blah!"
Oh, that's even better actually. Thanks again.