when am passing like this am getting output correctly
string st = "Select attandence.ID,lastname from student,attandence WHERE attandence.inouttime = '5/18/2012' and attandence.id=student.id and attandence.inout=1";
but when am passing the date as a string or datetime format am not getting the any output
string dt = dateTimePicker1.Value.ToShortDateString();
string st = "Select attandence.ID,lastname from student,attandence WHERE attandence.inouttime = " + dt.ToString() + " and attandence.id=student.id and attandence.inout=1";
i also tried dt only at the place of dt.ToString() but am not getting
in my msaccess file i tested the date field with both text and date time.
But not get the output
please help me
Hi i have a problem with c# to get date and time with ms access
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted May 18, 2012, 2:51 AM EDT
string st = "Select attandence.ID,lastname from student,attandence WHERE attandence.inouttime = #" + dt.ToString() + "# and attandence.id=student.id and attandence.inout=1";
znaneswar kodavanti18 reputationPosted May 18, 2012, 2:56 AM EDT