Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Get date when someone was a certain age!

Author  Topic 

killtacularmania
Starting Member

22 Posts

Posted - 2009-12-21 : 16:17:00
Hey guys I have what I think is a pretty simple question. I need to know when someone turned a certain age. So using the person's DOB I need to find when they turned 13. How would I do this? Thanks

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-12-21 : 16:21:29
I'm not sure I'm understanding this correctly....Given the DOB..you need to find the date when they will turn 13??

Isn't it just adding 13 yrs to the DOB? Or am I oversimplifying it?
declare @d datetime
set @d = '1982-10-04'
select dateadd(year,13,@d)
Go to Top of Page

killtacularmania
Starting Member

22 Posts

Posted - 2009-12-21 : 16:23:35
WOW MAJOR BRAIN FART ON THIS ONE!!!!! Sorry I didn't even think of that.
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-12-21 : 17:10:11
Np..It happens to everyone
Go to Top of Page
   

- Advertisement -