This is a migrated thread and some comments may be shown as answers.

Getting the last date of the next month

1 Answer 298 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Iron
Iron
Iron
Louis asked on 13 Sep 2019, 03:25 PM

Hello.

 

I try to get the last date of the next month in my report.  And it's have to work fine even at the end of the year.  By example, if i print my report in december 2019 i want to display on it Jan, 31 2020.

Any suggestion will be very appreciate.

Have nice day everyone.

 

 

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 17 Sep 2019, 12:11 PM

Hi Louis,

You need to use the Date and Time Functions

- AddMonths to get the first day of the next month;

- AddDays to add the days till the last day of the month;

The expression has to look as follows:

 = AddDays(AddMonths(Fields.Date, 2), - Fields.Date.Day)

You can also check the attached report which demonstrates the approach.

Regards,
Neli
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Louis
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Neli
Telerik team
Share this question
or