For a given date_part, this function returns the last day of the time interval for the input date, following a standard Gregorian calendar.
Syntax
GetLastDay ( date, date_part )
Parameter | Description |
---|---|
date | A number representing the input date between January 1, 1970 and Dec 31, 2037. The number is the number of seconds elapsed since midnight, January 1, 1970. To retrieve this number, use any of the following functions: Today(), TodateEx(), GetFirstDate(), GetLastDate(), DateRoll(). Date-Time type attribute properties of a member can also be used to retrieve this number. For example: Product.currentmember.[Intro Date] returns the Introduction or release date for the current product in context. [Cola].[Intro Date] returns the Introduction or release date for the “Cola” product. |
date_part | Defined time components of the standard calendar.
|
Notes
This function can be used for getting the truncated date of an input date for a given date part, following a standard Gregorian calendar.
Example
Assuming today’s date is April 15 2007, consider the following scenarios.
GetLastDay(Today(), DP_YEAR)
returns the last day of the year, Dec 31 2007
GetLastDay(Today(), DP_QUARTER)
returns the last day of the quarter, Jun 30 2007
GetLastDay(Today(), DP_MONTH)
returns the last day of the month, Apr 30 2007
GetLastDay(Today(), DP_WEEK)
returns the last day of the week, Apr 21 2007
See Also