Answers for "sql get week commencing monday"

SQL
1

sql week commencing date

DATEADD(dd, -(DATEPART(dw, [Date])-1), [Date])
Posted by: Guest on October-02-2020
1

sql week number starting monday

BEGIN TRANSACTION;

/* Table Creation And Insertions */
CREATE TABLE week(Number integer PRIMARY KEY, Name text);
  INSERT INTO week VALUES(1, 'Monday')
  INSERT INTO week VALUES(2, 'Tuesday')
  INSERT INTO week VALUES(3, 'Wednesday')
  INSERT INTO week VALUES(4, 'Thursday')
  INSERT INTO week VALUES(5, 'Friday')
  INSERT INTO week VALUES(6, 'Saturday')
  INSERT INTO week VALUES(7, 'Sunday')
COMMIT;

/* Queries */
SELECT name AS 'Day'
FROM week
WHERE name = 'Monday';

/* Returns Monday' */
Posted by: Guest on July-26-2021

Code answers related to "sql get week commencing monday"

Code answers related to "SQL"

Browse Popular Code Answers by Language