am stuck in a sql problem. I need something like this
M S C
1 sent 12
1 checked 15
1 rejected 9
2 sent 20
2 checked 18
3 rejected 10
Where M stands for Month, S for Status and C for Count respectively. What i want to achieve is to group the above example by Month
Wanted:
M S C
1 sent 12
checked 15
rejected 9
2 sent 20
checked 18
rejected 10
EDIT 1
Right now the sql statement looks like this:
select month, status, sum(hit) as count
from myTable
where dateletter between "date from" and "date to"
group by month,status order by month, status
Edit 2
How would i achieve this too
1 2
Sent 12 20
Checked 15 18
Rejected 9 10
where 1,2 represent the month values from database.
In the query you cannot group further, you will have to do this in a report. The query is OK and can serve as record source for a report. In such a report, you would insert a group header for each month.
You could however make a pivot query
This would return the status in columns