Alpha Video Training
Results 1 to 3 of 3

Thread: Filtering a Grid by Date Values

  1. #1
    Member RIckyRel's Avatar
    Real Name
    Ricky Relouw
    Join Date
    Dec 2009
    Location
    Australia, Vic, Ballarat
    Posts
    114

    Default Filtering a Grid by Date Values

    I'm having trouble figuring out how to filter a grid by date values:

    I have a list of reports that I want the user to be able to view in a grid.

    E.g. Each report has a "Report date"

    What I'm trying to achieve is when the grid is initially loaded it only loads the last 12 months of reports dates:

    But in the search filter I would also like the option for the user to enter a date older than the last 12 months eg. last 24 months and be able to view these reports in the grid if wanted.

    Eg:

    If the user logs into the app and view the reports grid - he/she will automatically see the last 12 months of reports. But if he/she wants to,,, he can filter the reports with a date eg:older than the last 24 months.

    There may be a simple way to do this but I'm stuck a the moment. I can filter the grid by a Date()-365 but then any date entered into the filter after this, will not show values older than the original (Date()-365) filter range.

    Hope this makes sense,

    In anticipation thanks...

  2. #2
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,396

    Default Re: Filtering a Grid by Date Values

    Hi Ricky,

    I'm not sure how you're getting the criteria from the end user, but I think the functions addmonths() or addyears() will make things easier/more accurate.
    Using the examples below, I think you can see the difference (I don't know if 1 day makes a difference for you or not).
    The code for the search will vary depending on how the user enters the criteria (2 years, 24 months, ..12/29/2010 can all be valid entries).

    Hope this helps a bit,

    Gregg


    Code:
    ? date() - 365
    = {12/30/2011}
    
    ? addyears(date(),-1)
    = {12/29/2011}
    
    ? addmonths(date(),-12)
    = {12/29/2011}

  3. #3
    "Certified" Alphaholic
    Real Name
    Chris Tappan
    Join Date
    Jun 2009
    Location
    Marietta, GA
    Posts
    1,303

    Default Re: Filtering a Grid by Date Values


Similar Threads

  1. Filtering Dropdown Box - using Variables for display/store values - grid/TabbedUI
    By Malcolm in forum Application Server Version 11 - Web/Browser Applications
    Replies: 8
    Last Post: 07-10-2012, 06:02 AM
  2. How to get the dynamic values in dropdown box by filtering with a textbox value?
    By satyanarayana in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 05-31-2012, 10:09 AM
  3. Setting values in parent grid, new values get revert to original values
    By bjacobson in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 11-11-2010, 11:53 AM
  4. Filtering child values
    By Firemedic934 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 25
    Last Post: 07-01-2009, 04:27 PM
  5. Filtering By Date In a Grid
    By Phil Rolf in forum Application Server Version 8
    Replies: 3
    Last Post: 08-18-2007, 03:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •