Re: Last day of the month
From: Dave F (dave_at_nospam.com)
Date: 07/14/04
- Next message: Gert-Jan Strik: "Re: Range query optimization help?"
- Previous message: Nitin Rana: "Re: Deadlock Issue"
- In reply to: Dave F: "Last day of the month"
- Next in thread: Aaron W. West: "Re: Last day of the month"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Jul 2004 13:10:40 -0700
Whoa! What helpful info!
To paraphrase Dr. Nick: Thanks Everybody!
"Dave F" <dave@nospam.com> wrote in message
news:Oq$NFXdaEHA.2792@TK2MSFTNGP09.phx.gbl...
> Is there an easy way to get the last day of the month using T-SQL date
time
> functions?
>
> THis will get me the first of the month:
>
> SELECT @EndDate= CAST(DATEPART(mm, GETDATE()) as varchar(2)) + '/1/' +
> CAST(DATEPART(yyyy, GETDATE()) as varchar(4))
>
> But to get the end of the month I think I have to use CASE and account for
> both the month and a leap year. Before I try this, can someone tell me if
> there is a simplier approach?
>
>
>
- Next message: Gert-Jan Strik: "Re: Range query optimization help?"
- Previous message: Nitin Rana: "Re: Deadlock Issue"
- In reply to: Dave F: "Last day of the month"
- Next in thread: Aaron W. West: "Re: Last day of the month"
- Messages sorted by: [ date ] [ thread ]