954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Date compare in a linq query

Hey guys,

I'm want to retrieve results from the database, where datetime picker given value, is equal to database value.


var _check = (from day in Check.tbl_employees
where day.d_from== _frm && day.d_to == _to
select new
{
day.desg_id,
}).FirstOrDefault();

datetime picker gives a value with its time,but i'm only interested in date.so i need help to compare in date which gives from the datetime picker(_from and _to) in database value(day.d_from,day.d_to).
And when comparing dates,does it compare time too?
need help ASAP.
thanks in advance.

drax

drax12
Newbie Poster
7 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

Hey guys,

I'm want to retrieve results from the database, where datetime picker given value, is equal to database value.

var _check = (from day in Check.tbl_employees where day.d_from== _frm && day.d_to == _to select new { day.desg_id, }).FirstOrDefault();

datetime picker gives a value with its time,but i'm only interested in date.so i need help to compare in date which gives from the datetime picker(_from and _to) in database value(day.d_from,day.d_to). And when comparing dates,does it compare time too? need help ASAP. thanks in advance.

drax

i found the way,
its simple.

date has to be datetimepicker.value.day

drax12
Newbie Poster
7 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: