I get this error first:
Msg 102, Level 15, State 1, Line 28
Incorrect syntax near '>'.
With the syntax of yours.
The I fix it with this syntax:
(CAST(SUM(nUsed_Min) AS FLOAT(2)) / CAST(SUM(nSize) AS FLOAT(2)) * CAST(AVG(100)) >= 80)
Then i get the following error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'CAST'.
Then I fit it with this syntax:
(CAST(SUM(nUsed_Min) AS FLOAT(2)) / CAST(SUM(nSize) AS FLOAT(2)) * CAST(AVG(100) AS NUMERIC(10, 2)) >= 80)
Then I get the following error:
Msg 147, Level 15, State 1, Line 28
An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.
:S eehm