Jump to content

How Old Is He ??!


Recommended Posts

SELECT Name,Birthday,(DATEDIFF("dd",Birthday,getdate())/365) AS Years,(DATEDIFF("dd",Birthday,getdate())/365*12) AS Months,(DATEDIFF("dd",Birthday,getdate())) AS DaysFROM People

Well I played around with this query I made but just can't get the math right. It givews the total years, total months , and total days...not what you are looking for but I found this article that has a T-SQL function to get the exact number of years, months, and days are between 2 dates.http://www.dnzone.com/forum/topic.asp?topic_id=156I hope this at least gets you started.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...