In my Application which is a POS software for restaurants, there is a form which the restaurant owner can use to get the daily, weekly, monthly and custom reports for his/her sales, as well as the total income in that period of time and the number of sold items. Now for the daily report and Custom report, I got no problems, but for the weekly report and monthly, I don't know, how to get the report of sold items of the current week or month. I searched a lot on google but I could not find the solution for my problem.
For example, Today is Monday, the first day of the week. I sold like 30 Burgers and some pizzas. After three days, I want to check the sales report for the current week, meaning from Monday. My app gives me the report from the same day of the last week until the current day. Here are the codes I used for the weekly report.
Connection.Open();
OleDbCommand Cmnd = new OleDbCommand("SELECT SomeFields FROM Table WHERE [Date] between @Date2 and @Date1",Connection);
Cmnd.Parameters.Add("@Date2", DateTime.Now.AddDays(-7).ToShortDateString());
Cmnd.Parameters.Add("@Date1", DateTime.Now.ToShortDateString());
OleDbDataAdapter GetList = new OleDbDataAdapter(Cmnd);
DataTable DataT = new DataTable();
GetList.Fill(DataT);
Datagridview.DataSource = DataT;
Connection.Close();
Now, this code gives me the sales report from the last 7 days until today, but what I want is to get the report only for the current week. So if it is the 3rd day of the week, it will give me only the report of 3 days.