|
-
Jun 11th, 2000, 09:35 PM
#1
Thread Starter
Lively Member
Want to find out somebody's age in years.
CalculateAge = DateDiff("yyyy", dat, Now)
The above almost works except that a new year is starting on 1st jan and not on their birthday.
Any ideas?
-
Jun 11th, 2000, 10:39 PM
#2
_______
this should give you a helping hand...
example from my junk...
Birthdate: February 06,1964
Stored in mdb as 02061964
Dim Bdate As String
Dim Bage As Integer
Dim Bdays As Long
Bdate = "02061964"
Bdate = Left$(Bdate, 2) + "/" + Mid$(Bdate, 3, 2) + "/" + Right$(Bdate, 4)
Bage = DateDiff("yyyy", Bdate, Now)
Bdate = DateAdd("yyyy", Bage, Bdate)
Bdays = DateDiff("d", Now, Bdate)
Select Case Bdays
Case 0
MsgBox "You are " + CStr(Bage) + "! Happy Birthday!"
Case Is > 0
MsgBox "Your birthday is in " + CStr(Bdays) + " days!"
Case Is < 0
MsgBox "Your birthday was " + CStr(Abs(Bdays)) + " days ago!"
End Select
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|