Login     Register

        Contact Us     Search

XLeratorDB/financial Documentation

SQL Server number of days in month function


DAYSINMONTH

Updated: 18 September 2014

Use the scalar function DAYSINMONTH to return the number of days in the month of the specified date.
Syntax
SELECT [wct].[DAYSINMONTH](
   <@StartDate, datetime,>)
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.
-----------
30

 

See Also

 



Copyright 2008-2013 WestClinTech LLC         Privacy Policy        Terms of Service