Monday, 30 September 2013

Get data for current month using Linq - VB

Get data for current month using Linq - VB

I have the following code which is listing the top 3 'names' in descending
order with a count of how many records that 'name' appears in in the
table. This is working ok.
Dim top3 = From s In dc.Suggestions
Group By Name = s.name
Into t3 = Group, Count()
Order By Count Descending
Take 3
I want to amend this so that it will only get a count of the number of
records each 'name' appears in for the current month. I can use
s.dateRaised to get the date of the record but i'm not entirely sure how
to write the code to get only the current month's records?

No comments:

Post a Comment