Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you join a passthru query with another query 1

Status
Not open for further replies.

Xzibit7

Technical User
Jun 20, 2006
172
US
I asked a question related to this earlier but found that this is the actual question I need to ask. If you can do this what is the format in SQL so it can find the other query.
 
If you have a Pass Through query defined in your app then it has a name - lets call it qryPTExample

And you have a 'normal' query - called qryTrial


Then you can create another query - qryDemo by simply refering to the other two queries - their origin is by that time forgotten as long as you are only doing SELECT queries etc ( Non data changing queries )

Code:
SELECT qryPTExample.field1, qryPTExample.field2, qryTrial.fieldA, qryTrial.fieldB
FROM qryPTExample 
INNER JOIN qryTrial
      ON qryPTExample.ExampleId = qryTrial.ExampleRef
ORDER BY field1, fieldA



'ope-that-'elps.

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top