Answers for "Sql week from monday"

SQL
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
0

sql server get week dates from week number

SELECT  
	DATEADD(DAY, 2 - DATEPART(WEEKDAY, GETDATE()), CAST(GETDATE() AS DATE)) [Week_Start_Date],  
	DATEADD(DAY, 8 - DATEPART(WEEKDAY, GETDATE()), CAST(GETDATE() AS DATE)) [Week_End_Date]
Posted by: Guest on August-12-2021

Code answers related to "Sql week from monday"

Code answers related to "SQL"

Browse Popular Code Answers by Language