dayofmonth

Return the day of the month

Syntax

dayofmonth(dt_expr)

Arguments

dt_expr A date expression.

Description

This function returns the day of the month in the specified date expression as a number between 1 and 31.

The data type DATE assumes the Gregorian calendar even for dates prior to the introduction of the Gregorian calendar. This means that databases that store historical dates prior to the introduction of the Gregorian calendar may not compute SELECT with date ranges, DAYOFWEEK, and WEEK correctly.

Example

select dayofmonth("2013-04-17") as "Day";

   Day
    17