C
Chad
Hello, I have a sample database I had found and wanted to change one thing.
It keeps track of how many days a person had taken a "Vacation" in the
current year. I would like to do a similar thing is to keep track of how many
times an employee had an excused tardy within the past 6 months from the
current day. The statement used to get the vacation totals is:
Public Function GetVacationAndHolidays()
Dim strSql
Dim frm As Form
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set frm = Forms!frmCalender
Set db = CurrentDb
' Vacation YTD
strSql = "SELECT Count(InputID) AS TotDays FROM tblInput "
strSql = strSql & "WHERE ((Year([InputDate])=" & CInt(gstrYear) & ") AND
((tblInput.UserID)=" & glngUserID & ") AND
((tblInput.InputText)='Vacation'));"
Set rs = db.OpenRecordset(strSql, dbOpenSnapshot)
frm!txtVacYTD = rs!TotDays
rs.Close
strSql = "'"
Set rs = Nothing
db.Close
Set db = Nothing
End Function
How would I count how many times the excused tardy was used for the past 6
months starting on the current day? Thanks!
It keeps track of how many days a person had taken a "Vacation" in the
current year. I would like to do a similar thing is to keep track of how many
times an employee had an excused tardy within the past 6 months from the
current day. The statement used to get the vacation totals is:
Public Function GetVacationAndHolidays()
Dim strSql
Dim frm As Form
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set frm = Forms!frmCalender
Set db = CurrentDb
' Vacation YTD
strSql = "SELECT Count(InputID) AS TotDays FROM tblInput "
strSql = strSql & "WHERE ((Year([InputDate])=" & CInt(gstrYear) & ") AND
((tblInput.UserID)=" & glngUserID & ") AND
((tblInput.InputText)='Vacation'));"
Set rs = db.OpenRecordset(strSql, dbOpenSnapshot)
frm!txtVacYTD = rs!TotDays
rs.Close
strSql = "'"
Set rs = Nothing
db.Close
Set db = Nothing
End Function
How would I count how many times the excused tardy was used for the past 6
months starting on the current day? Thanks!