This project is read-only.
1

Resolved

Filtering on date returns no result when date2 is before date1

description

On a column that contains date, when you filter between two date, if the second date is before the first date, then no data are displayed.

FileringOnDate

In the OKButton_Click method of the SetFilterForm class you should write :
else if (this.FilterTypeComboBox.Text == this.RM.GetString("setfilterform_filtertypecombobox_between"))
 {
     DateTime dt1 = ((DateTimePicker)this.val2contol).Value;
      if (dt.CompareTo(dt1) > 0)
          {
             DateTime tempDateTime = dt;
             dt = dt1;
             dt1 = tempDateTime;
           }

      if (this.timeFilter)
      {
         this.filterString += ">= '" + dt.ToString("o") + "'";
         this.filterString += " AND " + column + "<= '" + dt1.ToString("o") + "'";
       }
       else
       {
          this.filterString += ">= '" + dt.ToShortDateString() + "'";
          this.filterString += " AND " + column + "<= '" + dt1.ToShortDateString() + "'";
        }
 }

comments

Zubyme wrote Jan 3, 2014 at 3:12 AM

Yes, it`s. I removed the automatic inversion of numbers as in previous versions.See this issue

Zubyme wrote May 27, 2014 at 4:40 AM

fix in next release

mastapee wrote Sep 28, 2015 at 12:09 PM

whedn you filter a colunm the data is not shown y