J JimP Apr 26, 2007 #1 Is there a 255 character limit to the length of a SQL SELECT statement in VBA, e.g. strSQL="SELECT... (max 255 chars yes or no)"?
Is there a 255 character limit to the length of a SQL SELECT statement in VBA, e.g. strSQL="SELECT... (max 255 chars yes or no)"?
M Marshall Barton Apr 27, 2007 #2 JimP said: Is there a 255 character limit to the length of a SQL SELECT statement in VBA, e.g. strSQL="SELECT... (max 255 chars yes or no)"? Click to expand... No, 64,000+ is the limit. If you are stuffing an SQL string into a Row or Record Source property, then the limit is 32,000+ (See Specifications in VBA Help)
JimP said: Is there a 255 character limit to the length of a SQL SELECT statement in VBA, e.g. strSQL="SELECT... (max 255 chars yes or no)"? Click to expand... No, 64,000+ is the limit. If you are stuffing an SQL string into a Row or Record Source property, then the limit is 32,000+ (See Specifications in VBA Help)
J JimP Apr 27, 2007 #3 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 "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
J John Spencer Apr 27, 2007 #4 StrSQL = "SELECT Field1, Field2, Field3 " & _ "Field4, Field5" & _ " FROM NameYourPoison Inner Join" & _ " OtherTable On NameYourPoison.ID = OtherTable.FID" & _ " WHERE x = y" -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County .. JimP said: 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 Click to expand...
StrSQL = "SELECT Field1, Field2, Field3 " & _ "Field4, Field5" & _ " FROM NameYourPoison Inner Join" & _ " OtherTable On NameYourPoison.ID = OtherTable.FID" & _ " WHERE x = y" -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County .. JimP said: 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 Click to expand...
M Marshall Barton Apr 27, 2007 #5 Two common styles: strSQL = "SELECT..... " _ & "FROM........" or strSQL = "SELECT..... " strSQL = strSQL & "FROM........"
Two common styles: strSQL = "SELECT..... " _ & "FROM........" or strSQL = "SELECT..... " strSQL = strSQL & "FROM........"