Is there a "standardized" way to break up a long SQL select statement, given
that " _" does not function as a line continuation for a string. e.g.
strSQL1 = "SELECT....."
strSQL2 = "FROM........"
strSQL =strSQL1 & strSQL2
>>Is there a 255 character limit to the length of a SQL SELECT statement in
>>VBA, e.g.
[quoted text clipped - 7 lines]
>
> (See Specifications in VBA Help)
John Spencer - 27 Apr 2007 19:26 GMT
StrSQL = "SELECT Field1, Field2, Field3 " & _
"Field4, Field5" & _
" FROM NameYourPoison Inner Join" & _
" OtherTable On NameYourPoison.ID = OtherTable.FID" & _
" WHERE x = y"

Signature
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.
> Is there a "standardized" way to break up a long SQL select statement,
> given that " _" does not function as a line continuation for a string.
[quoted text clipped - 15 lines]
>>
>> (See Specifications in VBA Help)
Marshall Barton - 27 Apr 2007 20:02 GMT
Two common styles:
strSQL = "SELECT..... " _
& "FROM........"
or
strSQL = "SELECT..... "
strSQL = strSQL & "FROM........"

Signature
Marsh
MVP [MS Access]
>Is there a "standardized" way to break up a long SQL select statement, given
>that " _" does not function as a line continuation for a string. e.g.
[quoted text clipped - 14 lines]
>>
>> (See Specifications in VBA Help)