i have a table of punch clock that users punches in and out everymonth
now i want that every new month the list will be cleared from the earlier month
e.x from 1 of january until end of january i see the times that the users loged in and out
when february comes then the list gets empty and they start to punch in the new month and so on
this is the table that i need to delete each month
i have a function that do a similar thing but it is everyday not everymonth
tnx in advanced
salsa31
now i want that every new month the list will be cleared from the earlier month
e.x from 1 of january until end of january i see the times that the users loged in and out
when february comes then the list gets empty and they start to punch in the new month and so on
this is the table that i need to delete each month
Code:
TableName EnterWork
values
EnterDate date/time
EnterDay Text
EnterName Text
EnterIN Date/Time
EnterOut Date/Time
EnterTotal Number
Code:
Dim NewID As Long
Dim strSQL As String
Dim rs As New ADODB.Recordset
Dim DateToday As Date
DateToday = CDate(Date & " 00:01")
Set rs = CN.Execute("SELECT * FROM TempCash ORDER BY TempDate")
While Not rs.EOF
If rs!TempDate < DateToday Then
CN.Execute "delete From TempCash where TempDate < #" & MyDate(DateToday) & "#"
End If
rs.MoveNext
Wend
End Function
salsa31