0

How to calculate someones age.

code, oracle

round((Sysdate - birthdate) / 365.25)

tags:
SQL, code
Tmiller said:
 
If you want to be really technical your equation is not correct. I assume the .25 is the attempt to account for leap year but this is according to the Julian calender. The Gregorian calender better fixed the error introduced by the Julian calender. So your equation would work better if you used 365.24219878 days per year.
 
posted 613 days ago
View Replies (1) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
spiraldev said:
 
The point of the snip is to get a round number like 31 not 31.80222
 
posted 613 days ago
Add Comment Reply to: this comment OR this thread
 
 
For some reason Tmillers' reply reminded me of a bumper sticker I saw the other day: "Not only do engineers not have a life, they can mathematically prove it!"

:D

Have a good weekend all...
 
posted 613 days ago
Add Comment Reply to: this comment OR this thread
 
Tmiller said:
 
Strangely enough, I learned about the whole Julian and Gregorian calender stuff from my wife last night. She tutors a fifth grader who asked a question about leap year. I just looked up the number so i could sound smart.
 
posted 613 days ago
Add Comment Reply to: this comment OR this thread
 

Search

Matt  Graf
View Matt Graf's profile on LinkedIn