1
我想列出CloseDate
大於DateTime.Now
的所有記錄。有關日期的LINQ查詢問題
我已經爲該查詢寫了一個查詢,但它沒有提取記錄,其中CloseDate
大於DateTime.Now
。
見下面
var query = (from x in objEntity.VacancyMsts
join o in objEntity.OrganizationMst on
x.OrganizationID equals o.OrganizationId into vacorg
from o in vacorg.DefaultIfEmpty()
where x.Status == true && x.CloseDate >= DateTime.Now
select new VacancyMstDTO
{});
我詢問是否有我的查詢任何問題嗎?
什麼SQL針對數據庫執行? – 2012-08-14 12:29:05
返回recots ..我的SQL查詢SELECT dbo.VacancyMst.PositionTitle,dbo.VacancyMst.Description,dbo.VacancyMst.PositionLocation,dbo.OrganizationMst.OrganizationName, dbo.VacancyMst.CloseDate FROM dbo.VacancyMst LEFT OUTER JOIN dbo.OrganizationMst ON dbo.VacancyMst.OrganizationID = dbo.OrganizationMst.OrganizationId WHERE(dbo.VacancyMst.Status = 1)AND(dbo.VacancyMst.CloseDate> = GETDATE()) – 2012-08-14 12:29:55
@Manatherin是兩條記錄在那裏 – 2012-08-14 12:30:29