Solved

LINQ Where Date = 02/2014 ?

Posted on 2014-03-25
2
219 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 74

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 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

17 Experts available now in Live!

Get 1:1 Help Now