Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT

Status
Not open for further replies.

NewBe2

Programmer
Jun 9, 2001
4
ZA
I have 2 tables: CUSTOMER and SLSREP with fields (amongst others)
CUSTOMER (Cur_Balance, Slsrep_Number ..)
SLSREP (Slsrep_Number ...)
How do I find the total Cur_Balance for the salesmen who have more than 4 (four) customers ???
All the mentioned fields have numeric data types.

Thanx in advance !!!
 
Enter the following into the SQL view of the Query Designer.

Select Slsrep_Number, Sum(Cur_Balance) As Tot_Balance
From CUSTOMER
Where Slsrep_Number In
(Select Slsrep_Number
From CUSTOMER
Group By Slsrep_Number
Having Count(CustID)>4)
Group By Slsrep_Number;
Terry
_____________________________________
Man's mind stretched to a new idea never goes back to its original dimensions. - Oliver Wendell Holmes
 
Thanks a lot for the quick responce !!!
It works perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top