... + row(1) = 26th when the person was off the 25th):
SELECT
EmployeeNo
, '1' + substring(CAST(DaysOffSick AS VARCHAR(10)), 2, 1000) AS DaysOffSick
, DATEADD(d, ROW_NUMBER() ...
... getdate()))
Seconds to Time SEC_TO_TIME( seconds ) CONVERT(varchar, DATEADD(ms, seconds * 1000, 0), 114)
Add/Subtract Date DATE_ADD(date,INTERVAL number datepart) DATE_SUB(date,INTERVAL number datepart) ...
... ASC, t1.Finish ASC) as 'RowNumber'
FROM
(
SELECT
DATENAME(dw, tt.[WeekDay]-1) AS 'Day',
dateadd(d, tt.[WeekDay] - 1, (SELECT TOP 1 StartDate FROM [pretendDatabase].[pretendSchema].[WEEKSTRUCTURE] ...
... my question:
SELECT
Catalog.Name AS ReportName
, MIN(ExecutionLogStorage.TimeStart) AS [First]
, MAX(ExecutionLogStorage.TimeStart) AS [Last]
, CAST(CONVERT(CHAR, DATEADD(millisecond, ...
... my environment: WinXP, BIDS (vs2008), TFS (vs2010), SSRS 2008 R2. The following examples assume today's date is Wednesday 03 August 2011 @ 11:46:
This Week:
-- Start Date (US format - mm/dd/yyyy)
=DateAdd("d", ...
... Date (european format - dd/mm/yyyy)
=CDate("01/" + cstr(month(today.now())) + "/" + cstr(year(today.now())))
-- To Date (european format - dd/mm/yyyy)
=dateadd("d",-1, CDate("01/" + cstr(month(today.now())+1) ...
... AS (
--Select First hour in range
SELECT CONVERT(DATETIME,@StartTime) AS [Time]
UNION ALL
--Add a record for every half-hour in the range (change based on slot times)
SELECT DATEADD(MI, ...
... @StartDate DATETIME, @EndDate DATETIME
--First day of current month
SET @StartDate = DATEADD(s,0,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0))
--First day to display on calendar
SET @StartDate = DATEADD(DAY,-DATEPART(WEEKDAY,@StartDate)+1,@StartDate)
--Last ...
... on the given date
SET @setId = (SELECT TOP 1 SetId FROM WEEKSTRUCTURE WHERE StartDate BETWEEN DATEADD(day, -6, @specifiedDate) AND DATEADD(day, 6, @specifiedDate))
SET @weekNumber = (SELECT TOP 1 WeekNumber ...
We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies. Read more about our Privacy Policy.