Hi,
I have a database in which a field describes the attendance status of a teacher.
T for late, P for present, A for absent.
I want to calculate the number of Ts Ps and As.
How can i do this.
Using ADODC and vb6 and Access.
Thanx
Hello, A post reply of killer42 is Very good and simple but if you want a long one
Heres my Step.
dim HoldLate' Holds the number of Late.
dim HoldPresent' Holds the number of Present
dim HoldAbsent' Holds the number of Absent.
'Count the Number Of Late.
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM TableTeacher WHERE attendance_status='T' "
adodc1.refresh
HoldLate=adodc1.Recordset.RecordCount
'Count the Number Of Present.
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM TableTeacher WHERE attendance_status='P' "
adodc1.refresh
HoldPresent=adodc1.Recordset.RecordCount
'Count the Number Of Absent.
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM TableTeacher WHERE attendance_status='A' "
adodc1.refresh
HoldAbsent=adodc1.Recordset.RecordCount
Regards
Ervin