DAYOFWEEK

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the day of the week as an integer.

Syntax 

1dayofweek(<date_value>)

Arguments 

Required 

  • <date_value>: A date, timestamp, or timestamptz value.

Returns 

Returns an integer from 0 (Sunday) through 6 (Saturday). NULL input returns NULL.

Considerations 

  • Uses Snowflake numbering, not ISO numbering.

Examples 

Get weekday number for Sunday 

Return the weekday number for January 7, 2024, a Sunday.

1SELECT dayofweek(DATE '2024-01-07') AS result;

Returns 0.

Get weekday number for Saturday 

Return the weekday number for January 13, 2024, a Saturday.

1SELECT dayofweek(DATE '2024-01-13') AS result;

Returns 6.

Related Documentation