Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to get weekday from old date in sql

select format(columnName, 'dddd') as WeekDay from tableName; -- SQL Server 17
Comment

get monday of current week sql

SELECT CURDATE() - INTERVAL WEEKDAY(CURDATE()) DAY AS startweek;
Comment

sql current day of week number

SELECT DAYOFWEEK(NOW());
Comment

Get monday of week date is in SQL

DateAdd(day, (-1* (DatePart(weekday, TIMESTAMP)  % 7)) + 2, TIMESTAMP)
-- If first day is sunday in SQL 
Comment

extract weekday from date in sql

SELECT WEEKDAY(date);
Comment

get week day from date in sql

SELECT TO_CHAR(your_table.date_colunm, 'DAY')
FROM your_table;
Comment

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] 
Comment

PREVIOUS NEXT
Code Example
Sql :: postgres like case insensitive 
Sql :: como consultar registros duplicados en mysql 
Sql :: sql order by multiple columns 
Sql :: sql server create constraint 
Sql :: find usage of table in sql server 
Sql :: how to change column name in mysql 
Sql :: mysql count by month 
Sql :: get all columns in a table sql 
Sql :: restart serial number for postgres 
Sql :: display all node label neo4j 
Sql :: postgresql random phone number 
Sql :: sql server remove primary key without dropping table 
Sql :: null value in column violates not-null constraint 
Sql :: influxdb list all tags for a measurement 
Sql :: datediff in sql 
Sql :: select random rows sql 
Sql :: sql joins 
Sql :: min max sql 
Sql :: PL SQL VARRAY of records 
Sql :: update in sql server table 
Sql :: sql query to check if column contains alphabets 
Sql :: install mysql 5.7 ubuntu 20.04 
Sql :: SQLSTATE[01000]: Warning: 1265 Data truncated for column 
Sql :: sql server check whether column has same equal values 
Sql :: sql left join 
Sql :: drop all triggers oracle 
Sql :: sql order by two columns 
Sql :: add week ending date sql server 
Sql :: oracle show error line number 
Sql :: Access PostgreSQL PSQl with sudo 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =