Alpha Video Training
Results 1 to 4 of 4

Thread: Filtering By Date In a Grid

  1. #1
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default Filtering By Date In a Grid

    I have a Grid that is being filtered by the following:
    Code:
    ((:refnum=Ref_Num.AND.Ref_Submit=.f.).OR.(:refnum=L1_Num.AND.Ar1_Submit=.f.).OR.(:refnum=L2_Num.AND.Ar2_Submit=.f.)).and.gamedate<=date()-8
    The filtering on the first portion with the arguments is working fine, my problem is with the date portion. What I am trying to do is to find records that have TODAYS date or the previous 8 days date.

    Using Todays date for date()
    When I use the "gamedate<=date()-8", no records are found

    I changed it to "gamedate<=date()" and records where found.

    How do I write the filter to limit the search to the 8 previous day limit?
    Last edited by Phil Rolf; 08-14-2007 at 10:28 AM.

  2. #2
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Filtering By Date In a Grid

    Phil,

    For the last part of your script ...and.gamedate<=date()-8 try

    Code:
    .and.gamedate<=ctod("date()-8")
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  3. #3
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Filtering By Date In a Grid

    Try the between function
    Code:
    .and. between(gamedate,date()-8,date())
    Last edited by Tim Kiebert; 08-18-2007 at 03:24 AM.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  4. #4
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Filtering By Date In a Grid

    :D My bet's on Tim's solution as I got my method just from one of Alpha's genies!
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




Similar Threads

  1. Filtering a Grid with a Session Variable
    By stevemreid in forum Application Server Version 8
    Replies: 1
    Last Post: 06-20-2007, 12:41 PM
  2. Filtering a Dropdown in a Grid Component.
    By den1s in forum Application Server Version 8
    Replies: 2
    Last Post: 04-12-2007, 09:30 AM
  3. AlphaDAO Filtering Grid with Session Variable
    By Louis Nickerson in forum Application Server Version 8
    Replies: 4
    Last Post: 03-16-2007, 07:46 PM
  4. Filtering Grid Linker
    By Dan Blank in forum Web Application Server v7
    Replies: 19
    Last Post: 12-27-2006, 11:36 PM
  5. Filtering a Grid with a Session Variable
    By jeff_schneidr in forum Web Application Server v7
    Replies: 2
    Last Post: 12-02-2005, 09:28 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
  •