Show TOC

DATE_FIRST_DAY_OF_WEEK OptionLocate this document in the navigation structure

Determines the first day of the week.

Allowed Values

0 – 6

Default

0 (Sunday)

Scope

Requires the SET ANY PUBLIC OPTION system privilege to set this option for PUBLIC or for other user or role. Can be set for individual connections or for PUBLIC role.

Option can be set at the database (PUBLIC) or user level. At the database level, the value becomes the default for any new user, but has no impact on existing users. At the user level, overrides the PUBLIC value for that user only. No system privilege is required to set option for self. System privilege is required to set at database level or at user level for any user other than self.

Requires the SET ANY PUBLIC OPTION system privilege to set this option. Can be set for an individual connection or for the PUBLIC role. You must shut down and restart the database server for the change to take effect.

Remarks

This option specifies which day is the first day of the week. By default, Sunday is day 1, Monday is day 2, Tuesday is day 3, and so on:

Table 1: DATE_FIRST_DAY_OF_WEEK Valid Values
Value First Day
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday

For example, if you change the value of DATE_FIRST_DAY_OF_WEEK to 3, Wednesday becomes day 1, Thursday becomes day 2, and so on. This option only affects the DOW and DATEPART functions.

The SAP SQL Anywhere option FIRST_DAY_OF_WEEK performs the same function, but assigns the values 1 through 7 instead of 0 through 6. 1 stands for Monday and 7 for Sunday (the default).