Solved

need to get the relationships out via query

Posted on 2012-03-29
3
258 Views
Last Modified: 2012-04-02
I have a table named AGCOMCREV (25,129 records).  It contains agent commission contract records with things like agent hierarchy (if there are other agents making an "override" commission on a product's sale, contract effective date, and specific commission percentages for each product sold and to whom it will be paid.

My problem is this: for every AgentCode in the table, I need to get their commissions grouped by ContractEffectiveDate.  The goal is to reconstruct the contracts and any hierarchies for a big conversion project underway.  The info was in a flat text file and I've cleaned it up in Excel before loading the info into Access.

I also need to be able to pinpoint every hierarchy in the table.  For example, I need to show that AgentCode "A31F" worked underneath "A30N" for the contract effective November 15, 1997 and each agent earned "X" percent for each product type sold.  Agt1 is always equal to AgentCode so you know they are the selling agent.  "A30N" will have their own entry that should NOT show "A31F" because they are atop the hierarchy.  There are other cases where 3 or more agents are involved in the same hierarchy.

Please tell me if this needs to be split up into smaller tasks because I don't want to overly complicate this if it doesn't need to be so.  Thanks!
Database22-for-EE.accdb
0
Comment
Question by:kbdaemon
  • 3
3 Comments
 

Author Comment

by:kbdaemon
Comment Utility
I forgot to mention that there should be lots of equivalent contracts - the percentages paid will be the same for all products.  In the end the problem should reduce down to maybe 20-30 different contracts, with many agents on the same contract type.
0
 

Accepted Solution

by:
kbdaemon earned 0 total points
Comment Utility
OK, I've been working alot on this and have made it to:

SELECT AGCOMCREV.AgentCode, AGCOMCREV.[1stYrCommAgt1]*100 AS Expr1, AGCOMCREV.ContractEffectiveDate
FROM AGCOMCREV
WHERE (((AGCOMCREV.PolicyType)="0") AND ((AGCOMCREV.PolicyAgeLimit)=70));

That gets me 154 records.  I used PolicyType="0" because that is always the largest paying product on the commission contracts and represents a contract "type" (100 for 100%, or 90 for 90%).
How do I include the relationships if there are agents receiving an override commission?  I would want to indicate what they earn on PolicyType="0", and I am assuming the contract effective dates are equal (?).
0
 

Author Closing Comment

by:kbdaemon
Comment Utility
closing question to ask in a different way since I got no responses.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now