Solved

LINQ Where Date = 02/2014 ?

Posted on 2014-03-25
2
223 Views
Last Modified: 2016-02-10
Q. How do I search by a specific Month/Year in LINQ?

var expenseList = (from e in Expenses
                                where e.Created.ToString("MM/yyyy") == "02/2014"
                                select c).ToList()

Open in new window

0
Comment
Question by:WorknHardr
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 300 total points
ID: 39954965
Try:

var expenseList = (from e in Expenses
                   where e.Created.Month == 2 && e.Created.Year == 2014
                   select c).ToList()

Open in new window

0
 

Author Closing Comment

by:WorknHardr
ID: 39956888
Excellent, thx
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Media.Imaging 1 18
VB.NET Repostiory Pattern 7 35
List<PaisEntity> - show some 1 24
Convert datetime to time string 10 19
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now