G
Guest
Dear All,
How to get the below date difference code in VB working for Access
Private Sub Command1_Click()
Dim y, w As Integer
y = (Date - CDate(Text1.Text)) \ 365
w = (Date - CDate(Text1.Text)) - y * 365
w = w \ 7
d = DateDiff("d", CDate(Text1.Text), Date)
MsgBox "Years" & Str(y) & "week" & Str(w)
End Sub
It works fine in VB, though not in access..
I need to know the how many years and weeks passed from date entered till
current date i.e. today.
Any help will be appreciated
Thanks
Gerald
How to get the below date difference code in VB working for Access
Private Sub Command1_Click()
Dim y, w As Integer
y = (Date - CDate(Text1.Text)) \ 365
w = (Date - CDate(Text1.Text)) - y * 365
w = w \ 7
d = DateDiff("d", CDate(Text1.Text), Date)
MsgBox "Years" & Str(y) & "week" & Str(w)
End Sub
It works fine in VB, though not in access..
I need to know the how many years and weeks passed from date entered till
current date i.e. today.
Any help will be appreciated
Thanks
Gerald