|
-
Oct 1st, 2001, 01:31 PM
#1
Thread Starter
Lively Member
easy one
How do you write a sql statement on multiple lines? The _ continuer doesn't seem to work for them.
Many Thanks
-
Oct 1st, 2001, 01:32 PM
#2
PowerPoster
-
Oct 1st, 2001, 01:33 PM
#3
Dim SQL As String
SQL = "SELECT yada FROM yada "
SQL = SQL & " WHERE yabba = 'dabba'
SQL = SQL & " AND ......
etc.
-
Oct 1st, 2001, 01:33 PM
#4
Frenzied Member
sSQL = "Select *"
ssql = ssql & " From Table"
-
Oct 1st, 2001, 01:35 PM
#5
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
-
Oct 1st, 2001, 01:35 PM
#6
Thread Starter
Lively Member
That's what I needed to know. Thanks!
-
Oct 1st, 2001, 01:36 PM
#7
Hyperactive Member
VB Code:
strSQL = "SELECT one, two, three " & _
"FROM table1 " & _
"WHERE one = 1"
that'll do it
-
Oct 1st, 2001, 01:37 PM
#8
Lively Member
Ampersand!
Try this:
sSQL = "SELECT * FROM " & _
"TableName WHERE " & _
"Blah blah blah!"
-
Oct 1st, 2001, 01:39 PM
#9
Thread Starter
Lively Member
Oh, that's even better actually. Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|