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

stored procedure

Status
Not open for further replies.

site

Programmer
Oct 23, 2001
44
AT
Hi, All,

Would you please tell me how to write stored procedure that return 'last day of the current year'?

Thank you a lot.
Jing
 
Hi, Robert,

Thanks for your quickly reply. I need this stored procedure to return last date(daytime)of the current year.

Thanks again.
 
One solution:

[tt]select convert(datetime, '12/31/' + convert(char(4), datepart(yy, getdate()) ))[/tt]

I prefer CAST to CONVERT, but I had to test this in Sybase before posting (don't ask), and Sybase doesn't support CAST. Robert Bradley
Support operation moo!
Visit the OpCow page to help in this cause
 
Robert,

Thank you very much.
Jing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top