dkilby
asked on
ms sql + dates
i would like to get the first day and last of the month of the previous month, i am using the following code, but would like the time for the startdate be 00:00 and end date 23:59 how can i modify to accomplish.
declare @StartDate datetime,
@EndDate datetime
select @StartDate = DATEADD(dd,-(DAY(DATEADD(m m,1,GetDat e()))-1),D ATEADD(mm, -1,GetDate ()))
select @EndDate = DATEADD(dd, -DAY(DATEADD(m,1,GetDate() )), DATEADD(m,0,GetDate()))
declare @StartDate datetime,
@EndDate datetime
select @StartDate = DATEADD(dd,-(DAY(DATEADD(m
select @EndDate = DATEADD(dd, -DAY(DATEADD(m,1,GetDate()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER