Hi,
I don't understand why this work in my stored procedure
SELECT database_name,
SUM(CASE(DATEPART(dayofyear,@curdate)) WHEN (DATEPART(dayofyear,stat_date)) THEN totalextents ELSE 0 END ) as 'Aujourdhui'
FROM USR_DATA_Espacedata
group by database_name
But I can not use IF instead of the CASE statement.
Thanks