Count how many leads each user has

Hi,
I have two tables

tblUsers
UserID  UserName

tblLeads
LeadID  UserID  LeadName

and I need to display how many Leads each User has.  The data is being displayed in a Users table with repeat region.   I should probably make a separate RecordSet for this calculation.
napsternovaDeveloperAsked:
Who is Participating?
 
cyberkiwiConnect With a Mentor Commented:
select u.userId, u.username, count(l.leadid) as numofleads
from tbluser left u join tblleads l on u.userid=l.userid
group by u.userId, u.username
0
 
napsternovaDeveloperAuthor Commented:
Yep I believe that is it.
0
 
napsternovaDeveloperAuthor Commented:
Strange, the repeat region only displays the count of the first record.  User 1 has 3 so it repeats 3
0
 
napsternovaDeveloperAuthor Commented:
Got it, thanks
0
All Courses

From novice to tech pro — start learning today.