It would help if you posted your original query. (Hint - View: SQL on the menu)
To get the count you need a distinct query that will return the just the StudentIDs and then you can run a count against that query. A generic SQL statement for that would look something like the following.
SELECT Count(*) FROM (SELECT Distinct StudentID FROM Yourquery)
"ercjfk" <ercjfk[ at ]discussions.microsoft.com> wrote in message news:5F2048EC-C460-4E7A-A078-4EA63FB2058C[ at ]microsoft.com...
[Quoted Text] > It isn't that I have duplicate information in my table. I created a query > that pulled lists of students who were enrolled in 5 different classes. > None > of the records are exactly alike in the query, but some students were > enrolled in more than one of the courses so their student ids appear > multiple > times in the query. I now want to count the number of unique student ids > in > the query. > > > "Jeff C" wrote: > >> You could try to Normalze your data. In other words it sounds like you >> have >> one big table with duplicate information in it. >> >> Put your table into a query and select just the students and their IDs, >> in >> the properties for the query select "Unique Records" = YES >> >> Then turn this into a make table query, you will then have a table made >> up >> of just the students. Open the tqable in design mode and on the field >> for >> Student ID make in indexed no duplicate and make it your primary key. >> >> Open up your Relationship Window and put your two tables into it, relate >> them on the Student ID. >> -- >> Jeff C >> Live Well .. Be Happy In All You Do >> >> >> "ercjfk" wrote: >> >> > I've created a query that lists the student ids for students who were >> > enrolled in particular courses (along with some other data). However, >> > some >> > students are enrolled in more than one course so the query contains >> > some >> > dulicate student ids. I want to get rid of the duplicated student ids >> > so that >> > each student appears in the list just once. >> > >> > I tried creating another query to count the values in the column, but I >> > don't have the option to select "Count Distinct" in the totals row as >> > the >> > Access Help suggested. Any ideas?
|