Retrieve Last Day of Month for Specified Date
Environment
| Product | Progress® Telerik® Reporting |
| Version | 19.1.25.521 |
Description
To obtain the last day of the month for a given DateTime parameter, use the following formula. For instance, if the parameter date is "2025-06-17", the formula will return "2025-06-30".
Solution
To calculate the last day of the month for a specified date parameter (Parameter1), use the following formula:
= Parameters.Parameter1.Value.AddDays(CDbl(1 - Parameters.Parameter1.Value.Day)).AddMonths(0).AddMonths(1).AddDays(CDbl(-1))
The fields of the data source component can also be used in the expression as long as they are a DateTime.
Explanation
- Replace
Today()with your parameter value, such asParameters.Parameter1.Value, in the formula. - The formula calculates the first day of the next month and subtracts one day to get the last day of the current month.
Example
Suppose the parameter Parameter1 has a value of "2025-06-17". The formula will produce "2025-06-30".