Eric, Thanks. I didn't look carefully enough at my statement. I thought everything was right since I had originally cut an pasted it from a working query, but must have dropped a letter when piecing it back together.
Steve -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Douglas Sent: Monday, August 01, 2005 10:38 AM To: [email protected] Subject: RE: [AccessDevelopers] String being truncated Oops, I forgot to correct the table name in my where statement - correct one is: sSql = "" sSql = sSql & " SELECT DISTINCT Offices.OfficeKey, Offices.Office" sSql = sSql & " FROM (Offices INNER JOIN LinkLionOffice ON Offices.OfficeKey = LinkLionOffice.OfficeKey)" sSql = sSql & " INNER JOIN (Districts INNER JOIN Clubs ON Districts.DistrictKey = Clubs.ClubKey)" sSql = sSql & " ON LinkLionOffice.OfficeKey = Clubs.ClubKey" sSql = sSql & " WHERE Districts.DistrictKey=" & iDistrictKey sSql = sSql & " ORDER BY Offices.Office;" Eric > -----Original Message----- > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of Eric Douglas > Sent: Monday, August 01, 2005 8:33 AM > To: [email protected] > Subject: RE: [AccessDevelopers] String being truncated > > Steven, > > It looks like you've got a couple of syntax errors in there. > First, one of your JOINs has no type; ie INNER, etc. Second, > you refer to the table District in your WHERE statement, and > the table name is Districts. > > The correct syntax is: > > sSql = "" > sSql = sSql & " SELECT DISTINCT Offices.OfficeKey, Offices.Office" > sSql = sSql & " FROM (Offices INNER JOIN LinkLionOffice ON > Offices.OfficeKey = LinkLionOffice.OfficeKey)" sSql = sSql & " INNER > JOIN (Districts INNER JOIN Clubs ON Districts.DistrictKey = > Clubs.ClubKey)" sSql = sSql & " ON LinkLionOffice.OfficeKey = > Clubs.ClubKey" sSql = sSql & " WHERE ((([District].[DistrictKey])=" & > iDistrictKey & "))" > sSql = sSql & " ORDER BY Offices.Office;" > > Hope that helps! > > Eric > > > -----Original Message----- > > From: [email protected] > > [mailto:[EMAIL PROTECTED] On Behalf Of slwasserman > > Sent: Saturday, July 30, 2005 3:33 PM > > To: [email protected] > > Subject: [AccessDevelopers] String being truncated > > > > I am trying to build a string argument for an sql statement as > > follows: > > > > Dim sSql As String > > > > sSql = "" > > sSql = "SELECT DISTINCT Office.OfficeKey, Office.Office " > > sSql = sSql & " FROM (Offices INNER JOIN LinkLionOffice ON > > Offices.OfficeKey = LinkLionOffice.OfficeKey) " > > sSql = sSql & " INNER JOIN (Districts JOIN Clubs ON > > Districts.DistrictKey = Clubs.DistrictKey) " > > sSql = sSql & " ON LinkLionOffice.ClubKey = Clubs.ClubKey" > > sSql = sSql & " Where District.DistrictKey = " & iDistrictKey > > sSql = sSql & " ORDER BY Office;" > > > > The string is getting truncated at about 150 characters and > my query > > naturally fails. I have seen this phenomenon before, but > have not been > > able to come up with any reason for it or solution. I have also > > developed databases where this problem has not occurred. > > > > I have tried running the string all on to one line, and > also using & _ > > with the same result. > > > > I must be missing something. Is it possible that I've > somehow limited > > the length a string can be? (The help file says they can be about 2 > > billion characters) Any help would be appreciated. > > > > Thanks, > > Steven Wasserman > > > > > > > > > > > > > > > > ------------------------ Yahoo! Groups Sponsor > > --------------------~--> <font face=arial size=-1><a > > href="http://us.ard.yahoo.com/SIG=12hi5m593/M=362131.6882499.7 > 825260.1510227/D=groups/S=1705115370:TM/Y=YAHOO/EXP=> > 1122770016/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org > > ">Get Bzzzy! (real tools to help you find a job) Welcome to > the Sweet > > Life - brought to you by One Economy</a>.</font> > > -------------------------------------------------------------- > > ------~-> > > > > > > Please zip all files prior to uploading to Files section. > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > ------------------------ Yahoo! Groups Sponsor > --------------------~--> <font face=arial size=-1><a > href="http://us.ard.yahoo.com/SIG=12h0s6v4h/M=362131.6882499.7 > 825260.1510227/D=groups/S=1705115370:TM/Y=YAHOO/EXP=1122917600 > /A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org > ">Get Bzzzy! (real tools to help you find a job) Welcome to > the Sweet Life - brought to you by One Economy</a>.</font> > -------------------------------------------------------------- > ------~-> > > > Please zip all files prior to uploading to Files section. > Yahoo! Groups Links > > > > > > > > Please zip all files prior to uploading to Files section. Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12htu6qup/M=362335.6886445.7839731.1510227/D=groups/S=1705115370:TM/Y=YAHOO/EXP=1122953792/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font> --------------------------------------------------------------------~-> Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
