Dave -
 
change it to:
 
select weeknum, (sum(unit)) from vuservweek where costcent = 30 group by weeknum
 
Your "WHERE clause" is on the original data in vuservweek - NOT on the results AFTER the grouping.  If you wanted a value after the grouping, then you would use HAVING - example:  HAVING (sum(unit)) > 100 would give you only those records, AFTER the grouping, where the sum of the units is > 100.
 
Sami
 
----- Original Message -----
Sent: Friday, October 12, 2001 9:20 AM
Subject: Error help

Why do I get the error "Illegal column specification (2512)" on the following:
 
select weeknum, (sum(unit)) from vuservweek group by weeknum having costcent = 30
If I drop the HAVING clause I get results.  There IS a costcent = 30 in the view and the column is spelled correctly.
 
tia
 
Dave Ebert
 

Reply via email to