I have a complicated problem...
I am trying to write an SQL statement, but I do not know how to establish the criteria for my statement...
Here is the basic information to start with:
Now, what I would like to accomplish is this:
1. For each EmpFile#, I need to count the number of times the Code "21" occurs.
2. If Code 21 occurs 4 times, then I want a MsgBox to generate. The same for 5, 6, and 7 times.
3. The same for Codes 22 and 23.
I will have this statement (or script, if someone takes on the dirty task of writing one for me, as I am a VB Learner) attached to a command button (btnCloseForm) on frmEmpInfo.
Any thoughts....suggestions????
Any and all help is, of course, always appreciated!!!
Kind Regards,
KMK
I am trying to write an SQL statement, but I do not know how to establish the criteria for my statement...
Here is the basic information to start with:
Code:
SELECT tblEmpInfo.[EmpFile#], tblEmpInfo.LName, tblAbsences.Date_of_Absence, tblAbsences.Code
FROM tblEmpInfo INNER JOIN tblAbsences ON tblEmpInfo.[EmpFile#] = tblAbsences.[EmpFile#]
WHERE (((tblAbsences.Date_of_Absence)>=Date()-365))
ORDER BY tblAbsences.Date_of_Absence;
1. For each EmpFile#, I need to count the number of times the Code "21" occurs.
2. If Code 21 occurs 4 times, then I want a MsgBox to generate. The same for 5, 6, and 7 times.
3. The same for Codes 22 and 23.
I will have this statement (or script, if someone takes on the dirty task of writing one for me, as I am a VB Learner) attached to a command button (btnCloseForm) on frmEmpInfo.
Any thoughts....suggestions????
Any and all help is, of course, always appreciated!!!
Kind Regards,
KMK