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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counter problem

Status
Not open for further replies.

rjkealey

Programmer
Feb 14, 2003
84
US
Hey All,
I am trying to get a value(fldSalesperson)from a access db and see how many deals they have per month

I need help or a tutorial on incrementing 2 vars after comparing to (fldSalesperson) IE:

varSP
varNum
varDeals

if fldSalesperson<>varSP(varNum) then
varNum++
varSP=""
varSP(varNum)=fldSalesperson
else
varDeals=varDeals++
response.write varSp(varNum,varDeals)
end if

I am having trouble getting this to increment the counter of each salesperson(there could be up to 10)then if it finds a match from a salesperson (varSP(varNum))already created I need it to increment only their deal counter then write a list of all salepersons and the amount of deals.

I would appreciate any help you guys could give me or steer me in the right direction
RJKealey

 
You might also try solving the problem with a different SQL query. Depending on your needs, it may be possible to use the count aggragate function with a group by clause to get the database to do this work for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top