Skip to content

Commit d457dfc

Browse files
github-actions[bot]KB BotIvetNikolovadnikolov-prg
authored
Added new kb article retrieve-last-day-of-month-telerik-reporting (#1736)
* Added new kb article retrieve-last-day-of-month-telerik-reporting * Update retrieve-last-day-of-month-telerik-reporting.md * Update retrieve-last-day-of-month-telerik-reporting.md --------- Co-authored-by: KB Bot <[email protected]> Co-authored-by: IvetNikolova <[email protected]> Co-authored-by: Dimitar Nikolov <[email protected]>
1 parent 17c5c50 commit d457dfc

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Retrieve Last Day of Month for Specified Date
3+
description: Learn how to retrieve the last day of the month for a specified date parameter
4+
type: troubleshooting
5+
page_title: Formula to Get Last Day of Month Using Date Parameter in Telerik Reporting
6+
meta_title: Formula to Get Last Day of Month Using Date Parameter in Telerik Reporting
7+
slug: retrieve-last-day-of-month-telerik-reporting
8+
tags: reporting, datetime, parameters, formula, expressions
9+
res_type: kb
10+
ticketid: 1690706
11+
---
12+
13+
## Environment
14+
15+
<table>
16+
<tbody>
17+
<tr>
18+
<td>Product</td>
19+
<td>Progress® Telerik® Reporting</td>
20+
</tr>
21+
<tr>
22+
<td>Version</td>
23+
<td>19.1.25.521</td>
24+
</tr>
25+
</tbody>
26+
</table>
27+
28+
## Description
29+
30+
To obtain the last day of the month for a given [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime) parameter, use the following formula. For instance, if the parameter date is `"2025-06-17"`, the formula will return `"2025-06-30"`.
31+
32+
## Solution
33+
34+
To calculate the last day of the month for a specified date parameter (`Parameter1`), use the following formula:
35+
36+
`= Parameters.Parameter1.Value.AddDays(CDbl(1 - Parameters.Parameter1.Value.Day)).AddMonths(0).AddMonths(1).AddDays(CDbl(-1))`
37+
38+
>note The fields of the data source component can also be used in the expression as long as they are a [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime).
39+
40+
### Explanation
41+
42+
1. Replace `Today()` with your parameter value, such as `Parameters.Parameter1.Value`, in the formula.
43+
1. The formula calculates the first day of the next month and subtracts one day to get the last day of the current month.
44+
45+
### Example
46+
47+
Suppose the parameter `Parameter1` has a value of `"2025-06-17"`. The formula will produce `"2025-06-30"`.
48+
49+
## See Also
50+
51+
* [Date and Time Functions]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/expressions-reference/functions/date-and-time-functions%})

0 commit comments

Comments
 (0)