Filtering data by Date

m.pacanam.pacana Member Posts: 75
Is it possible to filter my data in the table box by date? Is it possible doing this using the SetFilter property? :) I have done it by this code:
TableName.SETFILTER(TBLCol_Date, '>myDate');

NOTE: myDate is a global variable. this code should filter records having a
TBLCol_Date later than my global variable myDate? 8)

Is this the right way to code this? :-k

Comments

  • ara3nara3n Member Posts: 9,257
    TableName.SETFILTER(TBLCol_Date, '>%1',myDate);
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • m.pacanam.pacana Member Posts: 75
    Thanks so much ara3n! \:D/
  • DrWatsonDrWatson Member Posts: 2
    This also works:

    TableName.SETFILTER(TBLCol_Date, '%1..',myDate);

    or

    TableName.SETRANGE(TBLCol_Date,fromDate,toDate);
  • krikikriki Member, Moderator Posts: 9,118
    Be carefull:
    TableName.SETFILTER(TBLCol_Date, '>%1',myDate); // means TBLCol_Date > myDate
    and
    TableName.SETFILTER(TBLCol_Date, '%1..',myDate); // means TBLCol_Date >= myDate
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • m.pacanam.pacana Member Posts: 75
    Thanks guys! \:D/
Sign In or Register to comment.