sql date week code example
Example 1: get hour from date sql
SELECT DATEPART(HOUR, GETDATE());
Example 2: sql week commencing date
DATEADD(dd, -(DATEPART(dw, [Date])-1), [Date])
Example 3: sql server week number
datepart(wk, DateToParse)
SELECT DATEPART(HOUR, GETDATE());
DATEADD(dd, -(DATEPART(dw, [Date])-1), [Date])
datepart(wk, DateToParse)