Logo

DAYSINMONTH

Updated 2023-10-06 23:46:31.927000

Syntax

SELECT [westclintech].[wct].[DAYSINMONTH](
   <@StartDate, datetime,>)

Description

Use the scalar function DAYSINMONTH to return the number of days in the month of the specified date.

Arguments

@StartDate

the specified date. @StartDate is an expression that returns a datetime or smalldatetime value, or a character string in date format.

Return Type

int

Remarks

If @StartDate is NULL then @StartDate = GETDATE().

Examples

SELECT wct.DAYSINMONTH('2014-09-18');

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"30"}]}

See Also

DAYSINYEAR - Number of days in the year of the specified date

NUMMONTHS - Number of months between two dates