Assuming weekday is required, the following 11 results were found.
has to work with any given date. First of all: Get this week's dates and days: SELECT DATE( DATE_ADD( NOW( ) , INTERVAL 0 - WEEKDAY( NOW() ) DAY ) ) AS ThisDate, DAYNAME( DATE_ADD( NOW( ) , INTERVAL 0 - WEEKDAY( NOW() ) DAY ) ) AS ThisDay UNION ALL...
DATEADD(day, -6, @specifiedDate) AND 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',...
AS SecondsElapsed FROM StaffActivities s WHERE WEEKDAY(s.DateTimeCreated)=0 AND YEARWEEK(s.DateTimeCreated)=YEARWEEK(NOW()) - $w_value AND s.StaffUserID='STRING_TO_REPLACE_PER_ITERATION' ) AS 'Monday', ( SELECT...
searching the web for a way of producing an outlook-style calendar within Business Intelligence Development Studio (BIDS). Weekdays along the top and then dates inside. Additionally we would like this linked to events in a database. I'm calling this...
T-SQL Record Separatorhttps://joellipman.com/articles/database/t-sql/t-sql-record-separator.html
the database wasn't designed with timestamps (despite being a timetabling and room booking system). But I do get given a weekday and the start date of the week... WITH tblDifference AS ( SELECT t1.*, ROW_NUMBER() OVER (ORDER BY t1.Date ASC, t1.Start...
SSRS / MDX Date Querieshttps://joellipman.com/articles/microsoft/ssrs/ssrs-mdx-date-queries.html
assume today's date is Wednesday 03 August 2011 @ 11:46: This Week: -- Start Date (US format - mm/dd/yyyy) =DateAdd("d", -(WeekDay(Today(),2))+1, Today()) // yields: 8/1/2011 -- End Date (US format - mm/dd/yyyy) =DateAdd("d", -1, DateAdd("d",...
Unix Date Format Specifiershttps://joellipman.com/articles/linux/unix-date-format-specifiers.html
Source: Wikipedia: Date (Unix) Format specifiers (format string starts with +) Specifier Description Values/Example Day %a weekday, abbreviated Mon %A weekday, full Monday %d day of the month (dd), zero padded 04 %e day of the month (dd) 4 %j day of...
) String Length LENGTH(string) 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())...
a Friday -- 2012-04-28 11:00:00 -- is a Saturday -- 2012-04-29 12:00:00 -- is a Sunday DATE_ADD( givenDate, INTERVAL ( 6 - weekday(givenDate) ) DAY ) AS WeDate -- yields -- 2012-04-29 -- this Sunday -- 2012-04-29 -- this Sunday -- 2012-04-29 -- this...
[WEEKMAPNUMERIC] wm ON (wm.[SetId] = tt.[SetId] and wm.[WeekId] = tt.[WeekId]) WHERE sd.[SetId] = @setId AND dateadd(d, tt.[WeekDay] - 1, @baseDate) = @GivenDate AND wm.[WeekNumber] = @weekNumber AND tt.[SiteId] = @siteId AND upper(sd.[Descrip]) not...
all SELECT CONCAT(s.LogID, ' ') AS ActivityID, t.TeamName AS Team, CONCAT(u.Firstname, ' ', u.Lastname) AS StaffName, CASE WEEKDAY(s.DateTimeCreated) WHEN 0 THEN 'Monday' WHEN 1 THEN 'Tuesday' WHEN 2 THEN 'Wednesday' WHEN 3 THEN 'Thursday' WHEN 4 THEN...