2
Reply

SQL Select Statement

shosho shosho

shosho shosho

May 11 2015 10:22 AM
475

how to read the records from database that have today's date using select statement.
I have tried doing this:


    DateTime todaysDate = DateTime.Now;

    string qr = String.Format(" SELECT tbl_Student.StudentName AS Name
FROM tbl_StudentTrack 
LEFT JOIN tbl_Student ON tbl_Student .Id=tbl_StudentTrack .StudentId
WHERE UserId = {0} ", userID, todaysDate);


But this doesnt seem to work, it just displays all the records.



Answers (2)