Assuming datename is required, the following 4 results were found.
SELECT calendar.WeekNumber AS AcademicWeek, CAST(DATEPART(dd, calendar.StartDate) AS VARCHAR(2)) + '-' + SUBSTRING(DATENAME(mm, calendar.StartDate), 1, 3) + '-' + CAST(DATEPART(yyyy, calendar.StartDate) AS VARCHAR(4)) AS Monday, CAST(DATEPART(dd,...
BIT_LENGTH(string) CHAR_LENGTH(string) LEN(string) DATALENGTH(string) Dates / Times Weekday Name DAYNAME(now()) DATENAME(dd, getdate()) Weekday Number DAYOFWEEK(now()) DATEPART(dw, getdate()) Month Name MONTHNAME(now()) DATENAME(mm, getdate()) Month...
DATEADD(day, 1, @specifiedDate)) SELECT @specifiedDate AS 'GivenDate', dateadd(d, tt.[WeekDay] - 1, @baseDate) AS 'Date', datename(weekday, dateadd(d, tt.[WeekDay] - 1, @baseDate)) AS 'Day', tt.[SiteId] AS 'Site', tt.[StartTime] AS 'Start',...
T-SQL Record Separatorhttps://joellipman.com/articles/database/t-sql/t-sql-record-separator.html
within the same select query based on a column that's different. So for example, I have data like the following: SELECT DATENAME(dw, StartDate) AS 'Day' FROM Timetable ORDER BY StartDate ASC, AnotherOrderByCol ASC, AndAnotherOrderByCol ASC -- Yields /*...