Help on Conditional SUM

G

Guest

I have a table with the sales information. The form will run a query and list
the Sales and commisions earned by the sales persons. Commisions are paid
after 2 months of sales. A query is run by specifying a sales person name and
result is posted to form as shown.


Sales : John Doe

Company Sales dated Commission Pay_date
ABC 1,000 12/1/2006 10.00 2/1/2007
ABC 2,000 1/5/2007 20.00 3/1/2007
CBA 3,500 2/2/2007 35.00 5/1/2007


Sales up-to-date : 6,500.00 <<<<< =SUM(Sales)
Commission paid: 30.00 <<<<< how to program this part
Commission pending: 35.00 <<<<< how to make this happen

Question 1. How do I calculate the commissions paid to inlcude only the paid
commsions?

Question 2. How do I calculate the commissions pending by including only
commissions to be paid in future?

Thanks for the help.
pw
 
M

Marshall Barton

Perry said:
I have a table with the sales information. The form will run a query and list
the Sales and commisions earned by the sales persons. Commisions are paid
after 2 months of sales. A query is run by specifying a sales person name and
result is posted to form as shown.


Sales : John Doe

Company Sales dated Commission Pay_date
ABC 1,000 12/1/2006 10.00 2/1/2007
ABC 2,000 1/5/2007 20.00 3/1/2007
CBA 3,500 2/2/2007 35.00 5/1/2007


Sales up-to-date : 6,500.00 <<<<< =SUM(Sales)
Commission paid: 30.00 <<<<< how to program this part
Commission pending: 35.00 <<<<< how to make this happen

Question 1. How do I calculate the commissions paid to inlcude only the paid
commsions?

Question 2. How do I calculate the commissions pending by including only
commissions to be paid in future?


Try something like:
=Sum(IIf(Pay_Date <= Date(), Commission, 0)
and
=Sum(IIf(Pay_Date > Date(), Commission, 0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top