Hi
DB is MySQL
i have the following tables: for readability i fill it with data so it's easy to understand what's needed
Orders Table

Code:
id  date              tourid    pax     ActivityID
1   01/04/2012      1          2           1
2   01/04/2012      2          1           2
3   01/04/2012      1          1           1
4   02/04/2012      1          1           3
Then i would like to maintain an Activity table, which is the Orders table grouped by Date and TourID as in:

Activity table:

Code:
ActivityID    Date           tourid     TotalOrders    TotalPax
    1          01/04/2012      1                3              4
    2          01/04/2012      2                1              1
    3          02/04/2012      1                1              1
How is it possible? I need to do this maintenance when inserting/updating orders. I am working on Web Application version 11.

Thanks
Jaime