title: Date compare in LINQ
body: <p>i was looking for date compare in LINQ and i found a code from searching google.</p>
  
  <pre><code>var currentDate = DateTime.Now.Date;
  </code></pre>
  
  <p>VisitorLog log = db.Context.VisitorLogs
           .Where(vl=>vl.inDate.Date == currentDate).FirstOrDefault();</p>
  
  <p>i need to know the above code works fine or not.</p>
  
  <p>how do i compare date in particular format like i compare date in sql server</p>
  
  <pre><code>compare(varchar(10),mydatefield,112)&gt;=compare(varchar(10),@mydatefield,112)
  </code></pre>
  
  <p>so please guide me how could i compare date using linq in particular format like above one.</p>
  
  <p>thanks</p>