Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
SELECT convert(varchar, TraDate, 101) As 'Date', count(1) as 'No. of Applications'
  FROM table
  where TraDate between '04-20-2015' and '04-27-2015'
  group by convert(varchar, TraDate, 101)
  order by convert(varchar, TraDate, 101) desc
Posted

1 solution

Try this:
C#
DateTime dFrom = new DateTime(20,4,2015);
DateTime dTo = new DateTime(27,4,2015);
var qry = datacontext
    .Where(a=>a.TraDate>=dFrom && a.TraDate<=dTo)
    .GroupBy(a=>a.TraDate.ToString("MM-dd-yyyy"))
    .Select(grp=>new
        {
            Date = grp.Key,
            CountOfApps = grp.Count()
        });
 
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