Jaa


dayname function

Applies to: check marked yes Databricks Runtime 16.1 and later

Returns the three-letter English acronym for the day of the week for the given date.

Syntax

dayname(expr)

Arguments

  • expr: A DATE or TIMESTAMP expression.

Returns

A STRING.

One of: ‘Mon’, ‘Tue’, ‘Wed’, ‘Thu’, ‘Fri’, ‘Sat’, ‘Sun’.

Examples

> SELECT dayname(DATE'2024-11-01' + CAST(offset AS INT)) AS days
    FROM range(8) AS t(offset);
 Fri
 Sat
 Sun
 Mon
 Tue
 Wed
 Thu
 Fri