>I would like to use sql to calculate the sum(SomeField) but broken
>down by
>Jan-March , April-June , July-Sept and Oct-Dec.
>
>Do I need four seperate sql statements and then merge the tables
>together.
SELECT {field stuff}, floor((month(date_required)-1)/3) as month_base ;
FROM {table stuff}
GROUP BY month_base
This takes the month, subtracts 1, divides by 3, and gets the lower
integer. Here's a table of the results:
1 -> 0
2 -> 0
3 -> 0
4 -> 1
5 -> 1
6 -> 1
7 -> 2
8 -> 2
9 -> 2
10 -> 3
11 -> 3
12 -> 3