Minimum Version Required: 23.01
Pre-Conditions
Required Permission - FusionEdit
Recommended Fusion I/II Certification
Steps
Returns the last day of the specified date part for a date or timestamp. Commonly used to return the last day of the month for a date or timestamp. Date Part can include Year, Month, Quarter, Week. Keep in mind that this will be the databases evaluation of the standard calendar format. This will not consider the Date Conversions table if it has been configured specifically. Sunday is considered the Last_Day for the WEEK time part.
Syntax
LAST_DAY(Date Value, Date Part)
Arguments
Date Value:
The date you start with to determine how your LAST_DAY function will operate.
Date Part:
Determines which Last Day that you want to see. Month will give you the last Day of the month based on the month that your Date Value is in. Week will give you the last day of the week that your Date Value is in.
Example
LAST_DAY(2/4/2019, MONTH) = 2/28/2019
LAST_DAY(2/4/2019, WEEK) = 2/10/2019 (Sunday)