1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
Sub Maj_T_Data_MAJ()
Dim t As DAO.Recordset, t2 As DAO.Recordset, profil As String, n As Long, heure As Date
DoCmd.RunSQL "DELETE FROM T_DATA_MAJ;"
Set t = CurrentDb.OpenRecordset("reqT_DATA")
Set t2 = CurrentDb.OpenRecordset("T_DATA_MAJ")
profil = ""
Do Until t.EOF
If profil <> t!profil Then
profil = t!profil
heure = t!heure
End If
n = DateDiff("s", heure, t!heure)
heure = t!heure
t2.AddNew
t2!profil = profil
t2!heure = t!heure
t2!delta = n
t2.Update
t.MoveNext
Loop
t.Close: t2.Close
End Sub |
Partager