dc

dc

  • NA
  • 663
  • 0

C# linq select datetime range

Oct 9 2012 3:37 PM
In a linq to sql statement in a C# 2010 console application, I want to be able to select a specific datetime frame. The timeframe
would be between is between srtdatetime and enddatetime. 

var elocation = (from iw in eData.books
                join ip in eData.IPack on iw.PID equals ip.PID
                                    where ip.TNum == pkId
                                    and iw.idate is between srtdatetime and enddatetime
                                    select iw).FirstOrDefault();

Can  you tell me in linq to sql how to select a datetime frame in a where statement?

Answers (1)