[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

LINQ Where Date = 02/2014 ?

Posted on 2014-03-25
2
Medium Priority
?
269 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 1200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 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