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!

last day of month 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I want to get "last day of each month" for my report.

Please help me how to get it using stored procedure.

Thanks a lot.

Wendy

 

You can use the intrinsic date functions to find the last day of the month.

Declare @td datetime
Set @td='8/2/01'
Select dateadd(d,-day(@td),dateadd(m,1,@td))

You can use a datetime column in place of the variable.

Select dateadd(d,-day(DateCol),dateadd(m,1,DateCol)) Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top