sql datepart
snippet in sql

datepart day of week

user3759

SELECT DATENAME(DW,'2007-10-30');  

sql datepart

user853

SELECT DATEPART(yy, '2017/08/25') AS DatePartInt;