I try to select records in database in 60 days 30 days 20 days differents in current date.
Please see this query in below.
var uploads = (
from files in _fileuploadRepository.Table
join product in _productRepository.Table on files.Event equals product.Id
where
(
product.EventDate != null &&
(product.EventDate.Subtract(DateTime.Now).Days <= 60 && product.EventDate.Subtract(DateTime.Now).Days >= 60) ||
(product.EventDate.Subtract(DateTime.Now).Days <= 30 && product.EventDate.Subtract(DateTime.Now).Days >= 30) ||
(product.EventDate.Subtract(DateTime.Now).Days <= 20 && product.EventDate.Subtract(DateTime.Now).Days >= 20))
&&
files.IsSkiped == false
select files;
).ToList();
But a error occurred this query.
I am clueless. Please Help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…