linq日期查询
//获取当天的数据 DrawRecordDA _recordDA = new DrawRecordDA(); var query = _recordDA.GetQuery(); //筛选 当天 //query = query.Where(q=>SqlFunctions.DateDiff("day",q.AddTime,DateTime.Now)==0); //筛选 当天 // query = query.Where(q=>q.AddTime.Day==DateTime.Now.Day); //筛选 本周 query = query.Where(q => SqlFunctions.DateDiff("week", q.AddTime, DateTime.Now) == 0); Console.WriteLine(query.Count());
本博有部分内容来自网络,如有问题请联系:hebeilijianghua@qq.com,并注明来自博客园。