In SQL, the function select datepart(dw,getdate()) returns a number representing the current day of the week. You want to use 1 for Monday, 2 for Tuesday, up to 7 for Sunday. How do you set this?
EXPLANATION
Datefirst says which day of the week will be treated as the start of the week and return the value 1,When setting Datefirst, 1 means Monday will be the start of the week. The default (7) means Sunday will be the start of the week. Zero is not a valid option and does not change the current setting.
For more details, see: https://docs.microsoft.com/en-us/sql/t-sql/statements/set-datefirst-transact-sql?view=sql-server-2017
0 comments:
Post a Comment