I have table in which there is data of Employee of Coming and Out of dateTime
Eg:
ID IN DateTime Out DateTime
PA1991 |
5/5/2014 9:16:41 AM |
|
|
5/5/2014 7:45:41 PM |
PA1991 |
5/6/2014 9:16:41 AM |
|
|
5/6/2014 7:45:41 PM |
PA1991 |
5/7/2014 9:16:41 AM |
|
|
5/7/2014 7:45:41 PM |
PA1991 |
5/7/2014 9:15:41 AM |
|
|
5/7/2014 8:45:41 PM |
NULL |
NULL |
|
NULL |
NULL |
I want to Show Dates of how many days Employee Came After 09:00AM ..
String s1 = "Select * From EmployeeLog Where EmployeeID='"+comboBox1.SelectedValue+"'";
ocmd = new OleDbCommand(s1, ocon);
OleDbDataReader odr1;
ocon.Open();
TimeSpan DefTime = new TimeSpan(09, 15, 00);
try
{
odr1 = ocmd.ExecuteReader();
while (odr1.Read())
{
DateTime EIn = (DateTime)odr1["EmployeeIn"];
DateTime EOut = (DateTime)odr1["EmployeeOut"];
TimeSpan X= EIn.TimeOfDay;
if (X > DefTime)
textBox1.Text = "Late";
}