473,395 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to address many-to-many relationship with different levels of relationships

Hi, I'm self taught and am trying to create a database in Access 2003 for our small Real Estate firm that allows us to track our Agents and their transactions. Additionally, we've set up a system where if an Agent refers another Agent to our firm they receive a portion of the fees we receive from them. They then also receive a smaller portion of the fees paid by agents referred by the agent they referred up to 4 levels. With differing percentages at each level.

I've created an agent table and a sponsor table both of which contain much of the same basic information and an append query to transfer that information. My question is as the Agents can have up to 4 types of relationships with many sponsors at any one time, I need to track the different level of sponsors in order to have Access calculate the fees we owe them. Do I have to make several different sponsor tables and then do many-to-many links or is there some other way to do this?

For example- Agent A, sponsors Agent B and gets 20% of B's fees. Agent B refers Agent C (Agent A gets 15% and Agent B get 20%). Agent C refers Agent D (Agent A gets 10%, Agent B gets 15% and Agent C gets 20%). Agent D refers Agent E (Agent A gets 5%, Agent B gets 10%, Agent C gets 15% and Agent D gets 20%).

Any help would be greatly appreciated as I'm tearing my hair out at this point!

Thanks,

Lynne
Oct 30 '10 #1
5 1972
ADezii
8,834 Expert 8TB
Is the assumption correct that an Agent can only be referred by another, single (1), Agent?
Oct 31 '10 #2
Yes. An agent could only be related to one sponsor (other agent) at one level (20%, 15%, 10% or 5%).

Thanks,
Lynne
Oct 31 '10 #3
Hi again. I wanted to clarify a little more. An agent could only be related to a specific other agent (sponsor) at a specific level (20%, 15%, 10% or 5%) but could be related to many different sponsors at those levels.

Thanks again.
Oct 31 '10 #4
ADezii
8,834 Expert 8TB
Hello Lynne. Download the Attachment, and let me know what you thing. The Logic is based on the premise that 1 Agent can refer many other Agents, but can only be referred by a single Agent. A single Table consisting of Sponsorship/Referral Chains for each Agent, plus an Algorithm based on the above premise is all that I used. Not really sure if I am on the right track with this one, but let me know in either event.
Attached Files
File Type: zip Agent Fees.zip (22.1 KB, 73 views)
Nov 1 '10 #5
Thanks so much for your help. It gives me a direction that I think might work into the rest of the database. Will let you know.
Nov 1 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: aaron | last post by:
I need some help with validating an email address. Right now, I am doing this: function sys_is_valid_email ($s) { if (preg_match ("/^.+@.+\..+$/", $s)) { return 1; } else { return 0; } }
7
by: gurtd_dauberie | last post by:
I can't get the correct IP address on Linux... The following code works properly on Windows and Unix. But on Linux, I always get the Loopback Address (127.0.0.1) Here is the code : //gets the...
2
by: Hunter Hou | last post by:
Hello, I have some code to implement combination of composite and command patterns. Here is the problem: ====== class Number {
117
by: Steevo | last post by:
Any suggestions as to the best programs for cloaking email addresses? Many thanks -- Steevo
35
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
9
by: sushant | last post by:
hello, my question is related with the address of a variable in C. suppose if i am printing the address of a variable, so that address will be virtual address or physical address. and why it'll...
0
by: Toldino_at_gmail_dot_com | last post by:
Hi, i'm desperatly searching a regex pattern for split a list of people address like this ADDRESS via a. pecoraro n. 4 p.zza sola, 14 via scardinata 117 via della scuola n.113 via...
4
by: jdcrief | last post by:
Using Visual C++2005 Expression Edition Having trouble outputting the value referenced by the pointer and then outputing the address of the pointer for the char. Any ideas would be greatly...
3
by: elvira_wang | last post by:
heya, what sort of address is displayed when this instruction for instance is executed printf("myvar location is 0x%lx\n", (long) &myvar); is it logical address or linear address, i.e. with...
36
by: Julienne Walker | last post by:
Ignoring implementation details and strictly following the C99 standard in terms of semantics, is there anything fundamentally flawed with describing the use of a (non-inline) function as an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.