0
我想能夠將dd添加到custQuery7。也就是說,從值大於3天前的trans_date中減去兩個日期date_paid。然後數一下。如何減去LINQ to SQL中的兩個日期?
var dd = m.date_paid.Value.Subtract(m.trans_date.Value) > 3;
var custQuery7 = ((from m in DataContext.pu_balance_hists
where m.desc_code == 141
&& m.trans_date.Value.Year == 2016
&& m.trans_date.Value.Month == 5
select m)).Count();
這裏是SQL查詢我試圖模仿:
select COUNT(*) as 'UnprocessedChques' from pu_balance_hist
where desc_code=141 and date_paid-trans_date>3
and YEAR(trans_date)=2016 and MONTH(trans_date)=5
要算什麼? – Hogan
未處理的檢查,我已經將SQL查詢添加到頂端的帖子。 –