Click here to Skip to main content
15,907,183 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
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();


datetime variable: logTimeStamp
Posted
Updated 7-Oct-18 9:14am

1 solution

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:

C#
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();


For further details, please see: Query a collection of objects (LINQ in C#) | Microsoft Docs[^]
Filter Weekdays from a Date Range - Christian Nagel's Blog[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900