MySql %w date format parameter equivalent for MS-SQL SERVER

1021 views sql-server

In MySQL to get the day of week we use '%w' format parameter.what is ms sqlserver equivalent doing that? i used 'ddd' but it give me the day name eg Saturday not the number.any suggestions?

this is what i've tried:

 select FORMAT( SYSDATETIME(), 'ddd', 'fa-IR' )

between i am aware of DATEPART(weekday , GETDATE()) but is lacks culture parameter.

answered question

1 Answer


You want DATEPART:


Note that the return value varies by language, as different languages treat different days as the first day of the week.

posted this

Have an answer?


Please login first before posting an answer.