Viewing 3 posts - 1 through 3 (of 3 total)
DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
SET @StartDate = '2008/03/01'
SET @EndDate = '2008/03/31'
set DATEFIRST 7
select DATEPART(dw, @StartDate) as firstday, (datediff(dd, @StartDate, @EndDate)/7)
select
case when DATEPART(dw, @StartDate) > 6 then
datediff(dd, @StartDate,...
February 25, 2009 at 8:03 am
EXEC master.dbo.xp_sendmail
@recipients = N'danw@Adventure-Works.com',
@query = N'SELECT * FROM INFORMATION_SCHEMA.TABLES',
@subject = N'SQL Server Report',
@message...
February 25, 2009 at 7:28 am
This way we can get the data sorted on hourly basis.
select
case when datetimecol between getdate() and DATEADD(hh, -1, getdate()) then primarycol end less1,
case when datetimecol between DATEADD(hh, -1, getdate())...
February 25, 2009 at 7:07 am
Viewing 3 posts - 1 through 3 (of 3 total)