I have a column in the database as EffectiveDate
which is the type of DateTime.
I have a linq query to get EffectiveDate from the table. but when I get I am getting EffectiveDate with time.
But in my linq query i need only Date I dont want the time for EffectiveDate.
how to write the Linq query for that?
Thanks
Call the
Date
property on anyDateTime
structor call
or use the "d" format when calling
ToString()
more DateTime formats here.Writing a Linq query could look like this:
and if
EffectiveDate
is nullable you can try:DateTime.Date Property
DateTime.ToShortDateString Method