Hello, I am working on a school project, it's a payroll system.
I have this current code that gets the difference of the TIME IN AND TIME OUT Of the user.
connection = new MySqlConnection(source);
command = new MySqlCommand("Select DATEDIFF(TimeIN) - DATEDIFF(TimeOUT) FROM payroll.attendance WHERE Date BETWEEN '" + datefrom.Value.ToString("yyyy-MM-dd") + "' AND '" + dateto.Value.ToString("yyyy-MM-dd") + "' AND EmployeeID='" + lblid.Text + "'", connection);
MySqlDataReader reader = command.ExecuteReader();
string diff = reader.GetString("DATEDIFF").ToString();
catch (Exception ex)
The code is not yet working it says "incorrect parameter count in the call to native function datediff"
Another problem is that, It must get the time difference of all the dates under the user input from the datepicker.
So its like this "SELECT DATEDIFF FROM MYDATEBASE WHERE Date Between 08-10-2016 AND 08-17-2016"
From this, it must get all the timedifference of the date between the user input.
Heres the sample of my database(attendance)