Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Birthday Date Calculation 1

Status
Not open for further replies.
Jun 23, 2008
55
GB
Hi

Is there a way to calculate the date that someone will turn 20 using their DOB? I want to do this in a view that I will then write my report on.
I've tried playing around with DateDiff but cannot seem to get a working solution.

Many Thanks
Annie
 
Try this. Swap out the variable for your table's column

Code:
DECLARE @PersonsBDay DATETIME
SELECT @PersonsBDay = '19900225'

SELECT DATEADD(year, 20, @PersonsBDay) AS DatePersonTurnsTwenty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top