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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get [date of Birth] as Year only

Status
Not open for further replies.

jamert

Programmer
Dec 9, 2007
80
CA
Hi i'm grabbing a column value "[Date of Birth]" but i only would like the year of it, is there a way to somehow truncate the return of the 'datetime' field ?

something like:
Convert(getDate(YYYY), [Date of Birth]) as dob

Thanks
 
select datename(year, [Date Of Birth])
Select DatePart(year, [Date Of Birth])
Select Year([Date Of Birth])
Select Convert(VarChar(4), [Date Of Birth], 121)


-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top