Working out how old someone is

I was poking fun at Col - implying he was old - 86 years old. If you add 86 and subtract Col's age, 86 you end up with 0. Add that to what you get when you subtract their birthday from todays date and you get their age :)

(Sorry, I'll try to keep humor in the 'cooler :p )
 
Whoa Ken-

That's heavy! Sorry, I didn't pick-up on it instantly.

Having said that, has anyone seen Mr. Hudson with
an example of his wife's erroneous age? Is there a VBA
problem here or perhaps a need for family counselling?
("She never told me she was that old before we got
married!")

I'm the first to admit the formula might be faulty, just
want to see an example of where Mr. Hudson thinks it
may have gone wrong.

Best wishes - Bob
 
Code:
Function GetAge(d1 As Date, d2 As Date) As Integer
   GetAge = CInt(Abs((d2 - d1) / 365.242) - 0.5)
End Function
 
Morning or whatever to you all

As the one who seemed to open up the thread by challenging ghudson I feel that I should contribute again.

I created a test using 3 different methods and masses of date options
1 the old fashioned microsoft option using Year Month and Day functions and loads of Ifs
2 Raskews which is similar to the one I have in a function
3 Microsofts quoted one
2 and 3 coded directly into the QBE grid 1 was in a function I had lying around

ALL RETURNED THE SAME CORRECT AGES the only difference between 2 an 3 was if there was a blank date field Raskews reurned #ERROR and Ms's a null

I cannot believe that people are trying to calculate age by dividiing the number of days by some variation on 365 logic tells you this just ain't going to work, you have to subtract the years and adjust for had birthday or not, just as we do in our heads. :)

Brian
 
raskew said:
You made the claim that the formula returned inaccurate results. You may be absolutely correct, or not. Please provide the dates you used to test the formula.

Bob
Odd but when I went to recreate my test everything now agrees. :rolleyes:

The date in question was the one I mentioned on the first page of this thread but it is now a mute point since the numbers jive with the different formulas [Raskew and Microsoft's]. I wish I had saved my work if I had know it could have caused a controversy. Time to put this thread to bed. ;)
 

Users who are viewing this thread

Back
Top Bottom