Advertisement

05.13.2008 at 10:31AM PDT, ID: 23398701
[x]
Attachment Details

How to include an addiitional table in an Open SELECT statement using SQL Server ?

Asked by zimmer9 in Microsoft ADP, MS SQL Server

I am writing an Access application using Access as the front end and SQL Server as the back end database. I use the attached code snippet to perform an Open SELECT statement.

Do you know how I could revise this OPEN statement to include another table named tblEmailAdds such that the tables tblPSEmail and tblbEmailAdds, which have the same data structure, are joined to table
tblA1099LNExpAll ?

For example:

Let say that table tblPSEmail has Branch 101, 102 and 104
and table tblEmailAdds has Branch 103

furthermore table tblA1099LNExpAll has branches 101, 102, 103 and 104.

I would like to match tblA1099LNExpAll against tables tblPSEmail and tblEmailAdds ordered by branch.

Start Free Trial
1:
2:
With rsList
   .Open "SELECT DISTINCT E.Branch, E.EMAILADD From tblPSEmail E INNER JOIN tblA1099LNExpAll S ON E.Branch = Left(S.[CPS Account Number],3) INNER JOIN tblA1099BranchNotRecd tbr on tbr.Branch =  Left(S.[CPS Account Number],3) ORDER BY E.Branch", cn, 2, 2
 
 
[+][-]05.13.2008 at 11:16AM PDT, ID: 21557725

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 11:17AM PDT, ID: 21557733

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 11:18AM PDT, ID: 21557747

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft ADP, MS SQL Server
Sign Up Now!
Solution Provided By: Rrooter
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.13.2008 at 03:34PM PDT, ID: 21559871

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 03:40PM PDT, ID: 21559911

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 04:31PM PDT, ID: 21560167

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628