Hi all,
Problem:
Code:
SELECT (FLOOR(( ACTIVITY_DATE - TO_DATE('05-01-04', 'MM-DD-YY') ) /7 )) As WEEKNO, SUM(some_data) FROM some_table WHERE TO_CHAR(ACTIVITY_DATE, 'MM-DD-YY') >= '05-01-2004' GROUP BY WEEKNO
Returns an invalid column name. I'm trying to sum columns based upon which week they fall into. If I take out the SUM and GROUP BY it works; I don't understand why I can't GROUP BY WEEKNO, I have an aggregate function in my select statement?
I've searched the web and can't find any answers and it's been about a day...
Any help would be greatly appreciated!
Thanks
Warren