VB.NET/Access - Add duplicate entries for each Student in table and display the total number of duplicates for each student in Datagridview

  • Thread starter Thread starter Chet.Horton
  • Start date Start date
C

Chet.Horton

Guest
In the attendance table I have the ID, StudentID, LastName, FirstName, and TrainDate fields. I enter attendance through a checkbox and datetimepicker.

It creates a record for each date that someone attends class and fills in the fields in that entry.

I can retrieve and display all the records but I want to count/add each duplicate entry for each person and display the total number along with the StudentID, LastName, and FirstName in a datagridview.

I wrote a query in access but it displays all entries and doesn't add them. I have searched for an answer but haven't found one or recognized it was the answer I did see it. I used the duplicate entry wizard query. As I mentioned it returns everything with a duplicate entry.

' RUN QUERY
Access.ExecQuery("SELECT COUNT(*) as Classes FROM TIGTotal")

' REPORT & ABORT ON ERRORS
If NoErrors(True) = False Then End

' FILL DATAGRID
dgvTestDue.DataSource = Access.DBDT



Can someone help me either come up with an access query I can use, and SQL statement that will add up eacch persons entries, or another way to get what I need?

I tried to attach images of what I am trying to do but it wouldn't let me.


Continue reading...
 
Back
Top