this this fit your needs?
Public Sub CalcAge(vDate1 As Date, _
vdate2 As Date, _
ByRef vYears As Integer, _
ByRef vMonths As Integer, _
ByRef vDays As Integer, _
ByRef vHours As Integer, _
ByRef vMin As Integer)
' Comments : calculates the age in Years, Months and Days
' original :http://www.mvps.org/access/datetime/date0001.htm
' Parameters:
' vDate1 - D.O.B.
' vDate2 - Date to calculate age based on
' vYears - will hold the Years difference
' vMonths - will hold the Months difference
' vDays - will hold the Days difference
' vhours - will hold the Hours difference
' vMin - will hold the Minutes difference
vMonths = DateDiff("m", vDate1, vdate2)
vDays = DateDiff("d", DateAdd("m", vMonths, vDate1), vdate2)
If vDays < 0 Then
' wierd way that DateDiff works, fix it here
vMonths = vMonths - 1
vDays = DateDiff("d", DateAdd("m", vMonths, vDate1), vdate2)
End If
vYears = vMonths \ 12 ' integer division
vMonths = vMonths Mod 12 ' only want leftover less than one year
Dim tmp1 As Long, tmp2 As Long, difTmp As Long
tmp1 = Hour(vDate1) * 3600 + Minute(vDate1) * 60 + Second(vDate1)
tmp2 = Hour(vdate2) * 3600 + Minute(vdate2) * 60 + Second(vdate2)
difTmp = tmp2 - tmp1
If difTmp < 0 Then
difTmp = 86400 + difTmp
vDays = vDays - 1
End If
vHours = Int(difTmp / 3600)
vMin = Int((difTmp Mod 3600) / 60)
End Sub
Sub PrintTheAge()
Dim aa As Integer, bb As Integer, cc As Integer, dd As Integer, ee As
Integer
CalcAge #12/31/1958 4:00:00 PM#, #1/26/2005 12:05:00 PM#, aa, bb, cc,
dd, ee
Debug.Print aa, bb, cc, dd, ee
End Sub
---
If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
Greg Maxey - 26 Jan 2005 22:15 GMT
Andi,
Thanks. I will have a look at this in more detail soon.

Signature
Greg Maxey/Word MVP
A Peer in Peer to Peer Support
> this this fit your needs?
>
[quoted text clipped - 48 lines]
> If you expect an answer to a personal mail, add the word "manfred" to
> the first 10 lines in the message MW
Greg Maxey - 27 Jan 2005 02:34 GMT
Andi,
Thanks. While my method seemed to work, I shelved it in favor of yours. It
seems the like the approach that developers of VB intended.

Signature
Greg Maxey/Word MVP
A Peer in Peer to Peer Support
> this this fit your needs?
>
[quoted text clipped - 48 lines]
> If you expect an answer to a personal mail, add the word "manfred" to
> the first 10 lines in the message MW
Word Heretic - 29 Jan 2005 02:35 GMT
G'day "Greg Maxey" <gmaxey@mvps.OscarRomeoGolf>,
Mate - use the DateDiff command - does all the hard work for you!
Steve Hudson - Word Heretic
steve from wordheretic.com (Email replies require payment)
Without prejudice
Greg Maxey reckoned:
>Andi,
>
>Thanks. While my method seemed to work, I shelved it in favor of yours. It
>seems the like the approach that developers of VB intended.