Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Second Join


Message #1 by george.smyth@u... on Thu, 6 Mar 2003 15:05:49
Sorry - I was referring to a different problem - not paying attention.
Doing a database drop this morning for State of Washington - and getting too
distracted! 

___________________________
Joe Horton
Database Developer / Software Engineer
WISHA/Legal Services Software Development
Department of Labor and Industries
Voice  (xxx) xxx-xxxx   fax  (xxx) xxx-xxxx

 -----Original Message-----
From: 	Brian Freeman [mailto:freeman@C...] 
Sent:	Thursday, March 06, 2003 7:43 AM
To:	sql language
Subject:	[sql_language] RE: Second Join

Whose example fails? and Which example fails?  What error do YOU get.
George got it to work just fine.

Brian Freeman
Bluwave Computing/Carnegie Technologies
www.bluewave-computing.com   / www.carnegie.com
(xxx) xxx-xxxx  ext. 415


-----Original Message-----
From: Horton, Joe (LNI) [mailto:HORJ235@L...]
Sent: Thursday, March 06, 2003 10:26 AM
To: sql language
Subject: [sql_language] RE: Second Join


Actually, I have found using your example, fails also fails in MS SQL too.
I've always been able to change the 2nd inner joint to a left join - but
such as an example as yours you may have needed both to be inner joins.  

___________________________
Joe Horton
Database Developer / Software Engineer
WISHA/Legal Services Software Development
Department of Labor and Industries
Voice  (xxx) xxx-xxxx   fax  (xxx) xxx-xxxx

 -----Original Message-----
From: 	George Smyth [mailto:george.smyth@U...] 
Sent:	Thursday, March 06, 2003 7:07 AM
To:	sql language
Subject:	[sql_language] RE: Second Join

Okay, I didn't realize that.  Adding parenthesis as in your first example
did it.

Thanks -

george


-----Original Message-----
From: Brian Freeman [mailto:freeman@C...]
Sent: Thursday, March 06, 2003 10:07 AM
To: sql language
Subject: [sql_language] RE: Second Join

First suggestion would be to use the query builder in access.  Access likes
parentheses around table joins.
This will probably work:

Select tblBoard.tblBoard_PK,  tblBoard.BoardName, tblBoard.Description,
tblUser.Username, tblUser.Email, tblBoard.Visible
From (tblBoard
  Inner Join tblUser On tblBoard.ModeratorRegNbr = tblUser.tblUser_PK)
  Inner Join tblMessage On tblBoard.tblBoard_PK = tblMessage.Board

or perhaps:

tblUser.Username, tblUser.Email, tblBoard.Visible
From tblMessage inner join
        (tblboard inner join tbl_User on
tblBoard.ModeratorRegNbr=tblUser.tblUser_PK)
        on tblmessage.Board=tblBoard.tblBoard_PK
might work also.

Good luck.

Brian Freeman

-----Original Message-----
From: george.smyth@u... [mailto:george.smyth@u...]
Sent: Thursday, March 06, 2003 10:06 AM
To: sql language
Subject: [sql_language] Second Join


I am trying to join three tables and am running into a problem.  I am
using an Access database and the following code works fine:

Select tblBoard.tblBoard_PK, tblBoard.BoardName, tblBoard.Description,
tblUser.Username, tblUser.Email, tblBoard.Visible
From tblBoard
  Inner Join tblUser On tblBoard.ModeratorRegNbr = tblUser.tblUser_PK

However, when I add the third table, I get an error.  Executing:

Select tblBoard.tblBoard_PK,  tblBoard.BoardName, tblBoard.Description,
tblUser.Username, tblUser.Email, tblBoard.Visible
From tblBoard
  Inner Join tblUser On tblBoard.ModeratorRegNbr = tblUser.tblUser_PK
  Inner Join tblMessage On tblBoard.tblBoard_PK = tblMessage.Board

results in the error message:

Syntax error (missing operator) in query
expression 'tblBoard.ModeratorRegNbr = tblUser.tblUser_PK
  Inner Join tblMessage On tblBoard.tblBoard_PK = tblMessage.Board'.

What operator might I be missing?

Thanks -

george








  Return to Index