Can't filter dates excluding empty dates

salberola
salberola Member Posts: 2
Hi,

I'm trying to apply a filter into a date field. I want to get records with a date informed until current date.

I've tried each of the following but no one is working:

SETFILTER("Date Field",'<>%1 & ..%2,0D,TODAY)
SETFILTER("Date Field",'%1..%2',01010000D,TODAY)
SETRANGE("Date Field",01010000D,TODAY)

Doing some tests, I've discovered that the following are not working also:

SETRANGE("Date Field",01012009D,31122009D)
SETFILTER("Date Field",'%1..',01012009D)

Can anyone help me?

Thank you!!

Comments

  • kriki
    kriki Member, Moderator Posts: 9,121
    SETFILTER("The Date",'..%1',TODAY); // this gets all dates until today, including 0D
    SETFILTER("The Date",'..%1&<>%2',TODAY,0D); // this gets all dates until today, including 0D

    PS: instead of using 01012009D, it is better to use DMY2DATE(1,1,2009).
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Belias
    Belias Member Posts: 2,998
    kriki wrote:
    SETFILTER("The Date",'..%1&<>%2',TODAY,0D); // this gets all dates until today, including 0D
    you mean excluding, isn't it? :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • kriki
    kriki Member, Moderator Posts: 9,121
    Belias wrote:
    kriki wrote:
    SETFILTER("The Date",'..%1&<>%2',TODAY,0D); // this gets all dates until today, including 0D
    you mean excluding, isn't it? :mrgreen:
    Right :whistle: :oops:
    Luckily you are here to check my posts on typos :D
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Belias
    Belias Member Posts: 2,998
    kriki wrote:
    Belias wrote:
    kriki wrote:
    SETFILTER("The Date",'..%1&<>%2',TODAY,0D); // this gets all dates until today, including 0D
    you mean excluding, isn't it? :mrgreen:
    Right :whistle: :oops:
    Luckily you are here to check my posts on typos :D
    It's my real work, of course \:D/
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog