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!

How to get end of year, not last day of the year, for a given date?

Status
Not open for further replies.

makeitwork09

Technical User
Sep 28, 2009
170
US
I am using SQL 2005.

I have found how to get the last day of the year for a given date.
Code:
select dateadd(year,datediff(year,0,getdate())+1,-1)

I am trying to figure out how to, for a given date, get the end of the year for that same day. For example if the date provided is 01/10/2013, I want to return 12/10/2013.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top