Advertisement

09.28.2008 at 09:55PM PDT, ID: 23770434
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

How would you write a query to get a particular result set ?

Asked by zimmer9 in SQL Query Syntax, Microsoft ADP

I am developing an Access application using Access as the front end and SQL Server as the back end database.

I am working with 2 SOURCE tables with the following FIELDS and values:

I would like to create 1 TARGET table named ztbl_Source_Funds_Ungrouped.

1) ztbl_Source_SSFIII

[Investor Name]    [Legal Entity]    Contributions   reportDt                            
ABC CO.               Class A           5.00                 2008-06-30 00:00:00.000
ABC CO.               Class A           8.00                 2008-06-30 00:00:00.000
XYZ. CO.              Class E            3.00                 2008-06-30 00:00:00.000
XYZ CO.               Class E            9.00                 2008-06-30 00:00:00.000

2) ztbl_Master_Template

[Account Name]   [Legal Entity]          [Fund Name]      id        Commitment
ABC CO.              MS Class A Units   SSFIII                 2908       500.00
XYZ CO.              MS Class E Units    SSFIII                 2910       700.00
XYZ CO               MS Class E Units    SSFIII                 2911           0.00

How would you create a SQL Insert Statement to achieve the following output using the
SQL Insert ?

INSERT INTO ztbl_Source_Funds_Ungrouped (id, [Fund Name],  Contributions, reportDt)
SELECT ztbl_Master_Template.id ...

I would like to match  the 2 source tables on:
ztbl_Source_SSFIII.[Investor Name] = ztbl_Master_Template.[Account Name]  AND
ztbl_Source_SSFIII.[Legal Entity]    LIKE '%' + ztbl_Master_Template.[Legal Entity] + '%'

To get the [Legal Entity] value is a matter of finding  ztbl_Source_SSFIII.[Legal Entity] anywhere in the
field value ztbl_Master_Template.[Legal Entity]   (% [Legal Entity] %)

Target (output) table
ztbl_Source_Funds_Ungrouped
                                                                               
id           Fund Name     Contributions     reportDt                               [Legal Entity]    Commitment
-------      --------------      ----------------    ------------------------------        ------------------ ---------------  
2908      SSFIII              13.00                 2008-06-30 00:00:00.000   Class A                500.00
2910      SSFIII              12.00                 2008-06-30 00:00:00.000   Class E               700.00

   Start Free Trial
 
 
[+][-]09.28.2008 at 11:44PM PDT, ID: 22594272

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.

 
[+][-]09.29.2008 at 02:45AM PDT, ID: 22594885

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.

 
[+][-]09.29.2008 at 02:50AM PDT, ID: 22594910

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: SQL Query Syntax, Microsoft ADP
Sign Up Now!
Solution Provided By: yuching
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-42 - Hierarchy / EE_QW_2_20070628