I have a problem which the were clause in my LinqToSql Query, here is an extract...
private void GetUsersByDOB(DateTime? DOB)
from usr in GetUsers() // returns IQueryable of users
where usr.tblContact.DateOfBirth == (DOB != null ? DOB : usr.tblContact.DateOfBirth)
The query works when a DOB is passed in (weather its null or has a value).... but the problem is, if the data in the DB is NULL, these are never returned whatever the input is.
It's to do with the evaluation of "where usr.tblContact.DateOfBirth == usr.tblContact.DateOfBirth" - am i doing this correct?
View Complete Post