Thursday, January 23, 2014

Comapare Date in Linq to Sql



I had the requirement to compare Date in Linq to Sql, i have 2 option to use :
in one case i can use myDate.Date it will also return date part with 12:00:00 AM time string too. To get only date part we need to use
date_modified1.Date > modified_date2.Date // retunrn date part + 12:00:00 AM

EntityFunctions.TruncateTime(date_modified1)>
EntityFunctions.TruncateTime(modified_date2) return Date part only

http://stackoverflow.com/questions/10647360/linq-to-sql-to-search-only-date-portions-of-a-date

No comments:

Post a Comment