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
  • 43,251
  • 5
  • 22
  • 52
Uddyan Semwal
  • 598
  • 1
  • 7
  • 23

4 Answers4

4

This sets the first day of the week to Monday

SET DATEFIRST 1;
Nipun Tharuksha
  • 2,496
  • 4
  • 17
  • 40
Shadiqur
  • 490
  • 1
  • 5
  • 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://learn.microsoft.com/en-US/sql/t-sql/statements/set-datefirst-transact-sql?view=sql-server-2017

Pierre
  • 794
  • 5
  • 15
2

You can use SET DATEFIRST like following.

SET DATEFIRST 1

You can read more about this here and here

PSK
  • 17,547
  • 5
  • 32
  • 43
2

Use this command :

SET DATEFIRST 1;

See this post

TheWildHealer
  • 1,546
  • 1
  • 15
  • 26