General information
Category:
Database DAO/RDO/ODBC/ADO
Hi!.
1. In Access, you cannot use a Pass-Through query as a View or table on another pass-through query.
What you must do is to insert the query as a sub-query in the FROM clause.
Like this.
<
SELECT a.BCHMCLASS AS Dept_ID,
a.BCHSCLASS AS TeamID,
a.BCHDESC AS Team_Name,
b.UserID,
b.USERNAME,
b.User_Name
FROM BCHSTD a,
(
SELECT b.USERNAME,
a.BCHDESC AS User_Name,
a.BCHSCLASS AS UserID,
a.BCHMCLASS AS MainID,
ltrim(RTrim(a.BCHCENTER)) AS TeamID
FROM BCHSTD a, SECUSER b
WHERE b.USERINI *= a.BCHINIT
and a.BCHMCLASS = '006'
) b
where a.BCHMCLASS = b.MainId
and a.BCHMCLASS = b.TeamId
ORDER BY a.BCHSCLASS, b.UserID;
>
2. This query won't work even on the Sql Server query analizer because it contains an outer-joined table present on a regular join.
Executing the query will return this error:
"Server: Msg 303, Level 16, State 1, Line 1
The table 'Orders' is an inner member of an outer-join clause. This is not allowed if the table also participates in a regular join clause."
3. Any query that works for Sql Server Query Analizer would work for Crystal Reports (so far I know).
4. Maybe if you use a Sub-Query in the SELECT Clause of the SELECT Statement to get the USERNAME (Because this is the only Field that needs an Outer-Join.
5. Another way to do it via Access is to link all the required tables, build the query in access and instead of outer-join use the DLOOKUP function to get the USERNAME Field.
I hope you find this helpful
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only