sql week commencing date
DATEADD(dd, -(DATEPART(dw, [Date])-1), [Date])
sql week commencing date
DATEADD(dd, -(DATEPART(dw, [Date])-1), [Date])
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' */
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us