Thursday, September 09, 2010 Register
XLeratorDB/financial Online Documentation
EOMONTH
No Comments Yet
wct.EOMONTH
 
Updated: 30 September 2008
Use wct.EOMONTH to calculate the date for the last day of the month that is the indicated number of months before or after the start date. Use wct.EOMONTH to calculate maturity dates or due dates that fall on the last day of the month.
 
Syntax
SELECT [westclintech].[wct].[EOMONTH] (
   <@Start_date, datetime,>
 ,<@Months, int,>)
Arguments
@Start_date
The date the number of months is added to or subtracted from. @Start_date is an expression that returns a datetime or smalldatetime value, or a character string in date format. 
@Months
an integer added to the @Start_date representing the number of months before or after the startdate. @Months is an expression of type int or of a type that can be implicitly converted to int.
Return Type
datetime
Remarks
·         To select the last day of the month of the @Start_date, set @Months to zero
·         To select the last day of a month after @Start_date, make sure @Months is greater than zero
·         To select the last day of a month before @Start_date, make sure @Months is less than zero
 
Example
SELECT wct.EOMONTH('2/15/2008'
,0)
Here is the result set
-----------------------

2008-02-29 00:00:00.000



  Comments

 |  View Topic History  |
Print  
Privacy StatementTerms Of UseCopyright 2010 WestClinTech LLC

BorderBoxedGrayBoxedGreenBlue Small width layoutMedium width layoutMaximum width layoutMaximum textMedium textSmall textBack Top!