datalink Posted February 2, 2007 Posted February 2, 2007 I know this is very simple but I can't seem to figure it out today. A system that I'm working on has an orders table and a commissions table. Commisions are related to orders by an order ID and a single order can have multiple commissions attached. Each commisions record also shows a SalesRepID. From the orders table I need to show the SalesRepID from the Sales rep that has the highest commission on that order. Any suggestions would be apprecaited.
mr_vodka Posted February 2, 2007 Posted February 2, 2007 If you only want to display only the one record with the highest commission and name, then when defining the relationship between the orders and commission table, you can have the commission table be sorted Descending based off the commission number. Then assuming that you have a relationship from your commission table and the salesperson table, you can just just put the two fields on your layout. Commission::CommissionAmt Salesperson::Name However, are there cases where the sales commission can be the same for more than one person? What about then? You may just be better off using a portal to display the info.
Recommended Posts
This topic is 6565 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now