Getting the last date of the next month

2 posts, 0 answers
  1. Louis
    Louis avatar
    85 posts
    Member since:
    Jun 2011

    Posted 13 Sep Link to this post

    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.

     

     

  2. Neli
    Admin
    Neli avatar
    190 posts

    Posted 17 Sep Link to this post

    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
Back to Top