score:0

if it's nullable you need to use the value property first, then call date on that:

p.create_dt.value.date

that said, using the date property will return the date with a timestamp of midnight, so it will still have a time associated with it. that won't be helpful for what you're describing. you can use @albertein's suggestion and check for the range.

score:0

if create_dt is allowed to have the null value in the database it will be mapped to a date? type in .net (that is the generic type nullable<data>).

you can retrieve the actual date of a nullable type by its value property.

try

from p in gl_projects
where p.create_dt.value.date == new datetime(2009,10,26)
select new p

but this will throw an exception if a create_dt is really null. to avoid this exception you have to ensure that the nullable type really contains a value:

from p in gl_projects
where p.create_dt.hasvalue && p.create_dt.value.date == new datetime(2009,10,26)
select new p

score:2

just check for the range

from p in gl_projects 
where p.create_dt >= new datetime(2009,10,26) && 
      p.create_dt < new datetime(2009,10,27) 
select new p

Related Query

More Query from same tag