Hi
i have created a view and my data is something like this now..
USerID |
pid |
date |
expenseByCustomer |
expenseByEmployee |
total exp |
Has read |
Has write |
1
|
3 |
12/15/2010 0:00 |
5423311.7 |
2060206.59 |
7483518.29 |
1 |
1 |
1
|
3 |
1/15/2011 0:00 |
6511198.06 |
3287308.85 |
9798506.91 |
1 |
1 |
1
|
3 |
2/15/2011 0:00 |
6776986.05 |
1464081.51 |
8241067.56 |
1 |
1 |
1
|
3 |
3/15/2011 0:00 |
8664801.13 |
2477348.81 |
11142149.94 |
1 |
1 |
Now i need to take the data as follows
select SUM(expenseByCustomer),SUM(expenseByEmployee),MONTH(DATE) from VW_NS_SPEND_PENDING_BY_USER where MC_USER_ID=1
and HAS_WRITE=1 group by month(DATE)
i was trying to get the data like this
from i in
from managerSpends in _mgr.vwManagerSpends
where (managerSpends.ID == App.DBUser.UserID && managerSpends.HasWrite == true)
select new { managerSpends.DATE, managerSpends.expenseByCustomer, managerSpends.expenseByEmployee })
group i by new { i.DATE.Value.Month} into g
select new
{
//i expected like i can take the data here using sum function but am not getting it here
};
can somebody help me to solve this??