here is what i have so far
If rstCustomer.EOF = False Then
rstCustomer.MoveFirst
Datenow = Format(Now, "mm/dd/yyyy")
Do
Bday = rstCustomer.Fields("Birthday")
Select Case Month(Bday)
Case Is < Month(Datenow)
Text1.Text = DateDiff("yyyy", Bday, Datenow)
Case Is = Month(Datenow)
Select Case Day(Bday)
Case Is < Day(Datenow)
Text1.Text = DateDiff("yyyy", Bday, Datenow)
Case Is = Day(Datenow)
Text1.Text = DateDiff("yyyy", Bday, Datenow)
Case Is > Day(Datenow)
Text1.Text = DateDiff("yyyy", Bday, Datenow) - 1
End Select
Case Is > Month(Datenow)
Text1.Text = DateDiff("yyyy", Bday, Datenow) - 1
Case Else
Text1.Text = 0
End Select
conn.Execute "Update Table1 set age ='" & Text1 & "' where ID ='" & 1 & "'"
rstCustomer.MoveNext
Loop Until rstCustomer.EOF = True
i attached my program
thank you
Attached File(s)
-
Age update.zip (31.9K)
Number of downloads: 16

New Topic/Question
Reply



MultiQuote



|