ChipW
|
Posted: 11/16/2003, 3:20 PM |
|
I need a report that summarizes (Group By) by ClassGroup and Class, then total up the number of hours for each Class and ClassGroup. I figured out almost everything but when I add the date column (to do date range query) I lose my grouping, and classes show individually again. I think I need to use a before show row event or something similar, but I'm not exactly sure of syntax and where it should go. I will be happy to prvide details (URL and/or SQL) if necessary or helpful.
Thanks in advance!
|
|
|
Ken Hardwick
|
Posted: 11/16/2003, 3:41 PM |
|
In order to do a group by on a set of fields and bring in additional fields that are not being group-by, you need to preform a group function on that field.
Like :
If all rows for that GroupClass,Class have the same date, then the three group function will return same answer.
Select
ClassGroup,Class,sum(Hours),max(Date_Field),Min(Date_Field),avg(date_Field)
from
Class_Table
group by ClassGroup,Class
Hope that helps...Ken
|
|
|
ChipW
|
Posted: 11/16/2003, 4:20 PM |
|
Thanks for the quick response Ken!
I'm not sure if this will help, or I'm not understanding.[the more likely ]
Wouldn't this just return 3 dates for all classes? or 3 dates for each class, in either case wouldn't that skew the date for the date range search?
|
|
|
|
|