0
Google에서 솔루션을 찾고있는 날이었습니다. 그러나 아직 해결되지 않은 것을 찾지 못했습니다.LynQ에서 Entity에 대한 DateTime의 날짜 부분 (사례 : 날짜는 동일)
나는 시작 날짜와 END 날짜를 선택하기 위해 내가 jQuery를 달력을 사용하고 양식을 가지고있다.
public Nullable<DateTime> AssignedDate { get; set; }
다음은 시작 일 미만 END 일이지만까지 그것은 바로 기록을 반환 내 LINQ
from c in entities.tDocumentStatus
orderby c.AssignedDate descending
where (EntityFunctions.TruncateTime(c.AssignedDate) >= EntityFunctions.TruncateTime(startDate.Date) && EntityFunctions.TruncateTime(c.AssignedDate) <= EntityFunctions.TruncateTime(endDate.Date))
select new ReportMapper()
{
DocumentName = c.CheckoutFolderName,
AssignedDate = c.AssignedDate==null? (EntityFunctions.TruncateTime(c.LastUpdatedOn)): (EntityFunctions.TruncateTime(c.AssignedDate)),
});
입니다
시작 날짜는 DATE를 종료하려면 동일한 경우 . 레코드를 반환하지 않습니다 (그러나 레코드가 있음).
이 LINQ의 잘못된 점은 무엇입니까?
그래서'startDate','endDate', 당신은 반환해야한다고하지만, 하나의 특정'c' 레코드의 값 것이 아니다입니까? – hvd
@hvd'startDate' = {12/5/2016 12:00:00 AM}'endDate' = {12/5/2016 12:00:00 AM} –
'TruncateTime'은 보통'DateTime '값, 생성 된 쿼리 명령에'WHERE startDate = endDate'가 포함되어 있는지 확인하고 DB에 대해 실행 해보십시오. –