Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hey all
i have a scenario where i need to check if there are any records in a certain table with a date that is equal chosen in a calendar
here is my query:

SQL
var test = (from c in db.Courses
                            where c.StartDate < DateTime.Today.Date
                            select c.CourseID).ToList();


No matter what value i compare to, the result is always null

where have i gone wrong ??
Thanks
Posted
Comments
Richard C Bishop 2-Sep-13 15:53pm    
You are not checking if they are equal, you are checking if one is less than the other.
Reda Makarem 3-Sep-13 0:36am    
yes....i know...i have plenty of records in the table that satisfy that condtion as well and yet the returned set is a null... thanks for your comments :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900