davecapone
Programmer
Is there a way to count the number of records in a recordset without having to loop through all the records and counting them that way? I'm guessing that there must be something like rd.count or something like that to return the count. I've tried using the COUNT command in my SQL statement but it won't let me retrieve all the fields that I need if I use it. My current SQL statement looks like:
mySQL="SELECT [Regional Contact Info].FName, [Regional Contact Info].MI," & _
" [Regional Contact Info].LName, [Regional Contact Info].RSID," & _
" [Regional Site Info].IDNum, [Regional Site Info].ContactID," & _
" COUNT([Regional Contact Info].RSID) AS NumContacts" & _" FROM [Regional Contact Info] LEFT JOIN [Regional Site Info]" & _
" ON [Regional Site Info].ContactID=[Regional Contact Info].RSID" & _
" GROUP BY [Regional Site Info].FName, [Regional Contact Info].MI," & _
" [Regional Contact Info].LName, [Regional Contact Info].RSID," & _
" [Regional Site Info].IDNum, [Regional Site Info].ContactID" & _
" ORDER BY [Regional Contact Info].LName"
Is there anyway to count these records?
Thanks,
David Capone
mySQL="SELECT [Regional Contact Info].FName, [Regional Contact Info].MI," & _
" [Regional Contact Info].LName, [Regional Contact Info].RSID," & _
" [Regional Site Info].IDNum, [Regional Site Info].ContactID," & _
" COUNT([Regional Contact Info].RSID) AS NumContacts" & _" FROM [Regional Contact Info] LEFT JOIN [Regional Site Info]" & _
" ON [Regional Site Info].ContactID=[Regional Contact Info].RSID" & _
" GROUP BY [Regional Site Info].FName, [Regional Contact Info].MI," & _
" [Regional Contact Info].LName, [Regional Contact Info].RSID," & _
" [Regional Site Info].IDNum, [Regional Site Info].ContactID" & _
" ORDER BY [Regional Contact Info].LName"
Is there anyway to count these records?
Thanks,
David Capone