Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / September 2004

Tip: Looking for answers? Try searching our database.

employee commissions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RR - 18 Sep 2004 16:22 GMT
I am wondering what tables and relationships  I would have to have to keep
track of one or several employees commissions per transaction.

One tracsaction can have one or several employees work on it, and the
commissions for each employee depends on how many employees worked on it.

Thanks
Squirrel - 18 Sep 2004 20:49 GMT
Hi,

I'd suggest considering something like this:

Employee table with EmployeeID as primary key and EmployeeName etc.
Transaction table with TransactionID as primary key and EmployeeID as
foreign key.

The question arises with regard how to treat the commissions.  If the
commission is calculated based on the number of employees working on the
transaction then this sounds like calculated data, i.e. unknown until all
the relevant employeeIDs have been entered.  If you need the commission
amount for queries and reports then it can be a calculated value rather than
a field stored in the database.  If you must store it in the database then I
think you need an update query to update the commission amounts after all
the employeeIDs have been entered - this assumes the commission is shared
equally between the employees.

HTH         -Linda

> I am wondering what tables and relationships  I would have to have to keep
> track of one or several employees commissions per transaction.
[quoted text clipped - 3 lines]
>
> Thanks
Pieter Linden - 19 Sep 2004 00:42 GMT
> I am wondering what tables and relationships  I would have to have to keep
> track of one or several employees commissions per transaction.
[quoted text clipped - 3 lines]
>
> Thanks

Employee---(M,M)---Transaction

So...

Employee--(1,M)---WorksOn---(M,1)---Transaction

So...

CREATE TABLE Employee(
EmployeeID     Autonumber    PRIMARY KEY,
FirstName      Text(25)      NOT NULL,
LastName       Text(25)      NOT NULL,
...
);

CREATE TABLE Transaction(
TransactionID  Autonumber   PRIMARY KEY,
...);

CREATE TABLE WorksOn(
EmpID         LONG INTEGER,
TransID       LONG INTEGER,
PRIMARY KEY (EmpID, TransID)
FOREIGN KEY (EmpID) REFERENCES Employee(EmployeeID),
           (TransID) REFERENCES Transaction(TransactionID));

And then the amount of the commission each gets is 1/n * value of
commission.  Where n is the count of values in WorksOn for the given
TransID.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.