MSQuery Err Msg: "Query Can Have Only One Outer Join"Last reviewed: July 2, 1997Article ID: Q115340 |
1.00
WINDOWS
kbusage kberrmsg kbtool
The information in this article applies to:
SYMPTOMSIn Microsoft Query 1.0, if you attempt to create more than one outer join, you will receive the following error message:
Query can have only one outer join CAUSEMicrosoft Query version 1.0 is limited to one outer join between two tables (Microsoft Query can perform several inner joins and/or a single outer join in a query).
WORKAROUNDTo work around this limit, you can create multiple outer joins by modifying the SQL statement containing the single outer join so that it performs multiple outer joins. After you make the modification, Microsoft Query will not be able to display the multiple outer joins, but it will be able to display the resulting query. WARNING: Your use or modification of the SQL statement provided in this article is at your own risk. Microsoft provides this SQL statement "as is" without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. Microsoft does not support modifications of the SQL statement to suit specific customer requirements. The following is an example of a double outer join using two related dBASE tables. In order for the example to work correctly, you must have a data source installed for the dBASE file format.
Creating Sample Databases
Creating Two Outer Joins
Use button. All of the fields will be added to the query. The following SQL statement will be displayed:
SELECT empa.FIRSTNAME, empa.LASTNAME, empa.LETTER, empb.FIRSTNAME, empb.LASTNAME, empb.COUNT FROM {oj c:\wow\empa.dbf empa LEFT OUTER JOIN c:\wow\empb.dbf empb ON empa.FIRSTNAME = empb.FIRSTNAME}
SELECT empa.FIRSTNAME, empa.LASTNAME, empa.LETTER, empb.FIRSTNAME, empb.LASTNAME, empb.COUNT FROM {oj c:\wow\empa.dbf empa LEFT OUTER JOIN c:\wow\empb.dbf empb ON (empa.FIRSTNAME = empb.FIRSTNAME and empa.LASTNAME=empb.LASTNAME.} You will then have your double outer join. The results are below:
FIRSTNAME LASTNAME LETTER FIRSTNAME LASTNAME COUNT John Smith a Sam Smith b Sam Smith 2 Mike Smith c Mike Smith 3 Jack Johnson d John Johnson e Sam Johnson f Sam Johnson 6 Mike Johnson g Mike Johnson 7 MORE INFORMATIONJoins are used in Microsoft Query version 1.0 to associate tables using common fields. In a two table example, an outer join retrieves all the records from one table and only those records from the other table for which values in the joined fields are equal.
REFERENCES"Microsoft Query User's Guide," pages 102-113
|
KBCategory: kbusage kberrmsg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |