Full Version: Counting Records
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
I am making a member database, in which I created a report to count all the members, but it won't count more than 99 members. Below is the code I used:
Also, I have records with the same FirstName and lastName, and the record works fine when I pull them up sorted by memberID, but when I try to sort them by last name, it doesnt allow duplicates.
Any ideas anyone?
Try basing your count on a query like this: select count(*) as Members from tblMembers. You may have to massage the SQL a bit if your back-end database is Access. The above will work on SQL Server. The "order by" statement seems to return a set, from what you say. A set allows no duplicates. make it "sort by lastName, MemberID" and try only to display the lastName and see what that does.
A quick PS to the posting above: did you use "select DISTINCT lastName" or just "select lastName"? That would explain the absence of duplicates.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.