Translate

Friday, 16 June 2017

sql: date name from any date we input

SELECT DATENAME(dw,GETDATE()) -- Friday
SELECT DATENAME(dw,convert(datetime,'1989-11-23'))


SELECT DATENAME(M,convert(datetime,'1989-11-23'))
SELECT DATENAME(YYYY,convert(datetime,'1989-11-23'))

No comments:

Post a Comment