3

I'm using Microsoft sql server and in the sql server by default first day of week is Sunday but I need to set it Monday is the first day of week.

Joakim Danielson
  • 35,353
  • 5
  • 20
  • 45
Uddyan Semwal
  • 584
  • 1
  • 6
  • 22

4 Answers4

4

This sets the first day of the week to Monday

SET DATEFIRST 1;
Nipun Tharuksha
  • 2,470
  • 4
  • 13
  • 38
Shadiqur
  • 468
  • 4
  • 18
3

You can use

SET DATEFIRST { number }

number
1      Monday
2      Tuesday
3      Wednesday
4      Thursday
5      Friday
6      Saturday
7      Sunday

Here the link to the official docs: https://docs.microsoft.com/en-US/sql/t-sql/statements/set-datefirst-transact-sql?view=sql-server-2017

Pierre
  • 736
  • 4
  • 14
2

You can use SET DATEFIRST like following.

SET DATEFIRST 1

You can read more about this here and here

PSK
  • 16,571
  • 4
  • 31
  • 42
2

Use this command :

SET DATEFIRST 1;

See this post

TheWildHealer
  • 1,453
  • 1
  • 14
  • 25