DAY

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the day field from a timestamp or interval. This function is equivalent to EXTRACT(DAY FROM ...).

Syntax 

1day(<timestamp>)
1day(<interval>)

Arguments 

Required 

  • <timestamp>: The timestamp to extract the day of the month from.
  • <interval>: The interval to extract the number of days from.

Returns 

Returns the day as an integer.

Examples 

Extract the Day from a Timestamp 

Get the day of the month from a timestamp.

1SELECT day(timestamp '2001-02-16 20:38:40') AS result;

Returns 16.

Extract the Day from an Interval 

Get the number of days from an interval.

1SELECT day(interval '42 days') AS result;

Returns 42.

Related Documentation