Forums

Forums / Developing Portals / Filtering Sub-Grid Data by Todays Date

Filtering Sub-Grid Data by Todays Date

Thread is closed for posting
2 posts, 1 answered
  1. c.arsenault
    c.arsenault avatar
    2 posts
    Registered:
    20 Aug 2015
    29 Dec 2015
    Link to this post
    I was just wondering if there is a way to pull in todays date into, say, a filter variable. The reason I ask is because I have two sub-grids, displaying upcoming and past data, and I was the upcoming grid to show data that the start date is > todays date, and past data showing the end date < today.

    Is this a possibility?
    What would I have to do to accomplish this task?

    Thank you!
  2. Missing user
    Missing user avatar
    Answered
    04 Jan 2016 in reply to c.arsenault
    Link to this post
    Hi Arsenault,

    Yes, it is possible to use today's date inside of the filters section of the fetch of a grid. For upcoming where the start date is > today's date, you can make use of this fetch:

    <filter type="and">
          <condition attribute="createdon" operator="next-x-years" value="100" />
     </filter>

    And for end date < today, you can use this:

     <filter type="and">
          <condition attribute="createdon" operator="last-x-years" value="100" />
     </filter>

    Let us know how it works out!

    Kind Regards,

    Chris Rooney.
    Last modified on 04 Jan 2016 17:01 by Missing user
2 posts, 1 answered