asassin GB

asassin GB

  • NA
  • 15
  • 500

Display records between two dates including extra hours

Sep 14 2018 8:18 PM
i have sales system that has two shifts(day and night) i need to display records in ReportViewer filtered by shift to calculate sales of each shift(am using datetimepicker to select dates and comboBox to select the shift).
 
i have tried this:
  1. private void shiftcomboBox_SelectedIndexChanged(object sender, EventArgs e)  
  2. {   
  3. this.sellsTableAdapter.FillBy1(this.kafDataSet4.sells,   
  4.    Convert.ToDateTime(dateTimePicker1.Value.ToShortDateString()),   
  5.       Convert.ToDateTime(dateTimePicker2.Value.ToShortDateString()),  
  6.          Convert.ToString(comboBox1.SelectedItem));  
  7.   
  8.  this.reportViewer1.RefreshReport();     
  9.      }  


i passed the dates from datetimepickers and it works but my problem is the second shift ends after midnight so that extra hours will not be included in the report so that gives wrong calculation of mony. 

Answers (1)