我如何使用LINQ每周列出一次? [英] How do I weekly listing with LINQ?

查看:64
本文介绍了我如何使用LINQ每周列出一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。我想用linq查询列出我的每周数据。我无法制作每周查询代码,你能帮忙吗?



我尝试过的方法:



Hello there. I want to list my weekly data with a linq query. I couldn't make the weekly inquiry code, can you help?

What I have tried:

LINQ Query;
<pre>  var k = db.vw_get_callLog.Where(x => x.tmkName =="Özge Topraktepe" && x.firstStatusText =="Tekrar Ara").ToList();





日期时间变量:logTimeStamp

推荐答案

好吧,你的问题没有很好地形成。请注意,我们无法读到您的想法或直接从您的屏幕上读取...



如果您想在检测字段中查询数据库,则必须添加此字段为其中条件。例如:



Well, your question is not well formed. Note, that we can not read in your mind or direct from your screen...

If you would like to query your database on dete field, you have to add this field to where condition. For example:

DateTime startDate = new DateTime(2018, 10, 1);
DateTime endDate = new DateTime(2018, 10, 7);
var weeklydata = db.vw_get_callLog
    .Where(x => x.logTimeStamp >= startDate && x.logTimeStamp <= endDate)
    .ToList();





详情请见:查询对象集合(C#中的LINQ) Microsoft Docs [ ^ ]

从日期范围过滤工作日 - Christian Nagel的博客 [ ^ ]


这篇关于我如何使用LINQ每周列出一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆