Click here to Skip to main content
15,889,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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).

What I have tried:

i have tried this:
C#
private void shiftcomboBox_SelectedIndexChanged(object sender, EventArgs e)
       { this.sellsTableAdapter.FillBy1(this.kafDataSet4.sells, Convert.ToDateTime(dateTimePicker1.Value.ToShortDateString()), Convert.ToDateTime(dateTimePicker2.Value.ToShortDateString()),Convert.ToString(comboBox1.SelectedItem));
               this.reportViewer1.RefreshReport();
       }


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.
Posted
Comments
[no name] 15-Sep-18 16:46pm    
You should have used a "shift number / name" in your design.

One works the "morning shift", "night shift", etc.

Anyways, you should know the "shift times" ... "hard code" them; shifts don't tend to change. (You want people to "invent" shift times on the go?)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900