I have a few columns: Week1, Week2, Week3, Week4, Week5
i.e.
Week1 = 5
Week2 = 0
Week3 = 10
Week4 = 7
Week5 = 0
How do I calculate the average based on the fields that are not zero?
Incorrect:
(5+0+10+7+0)/5 = 4.4
Correct:
(5+0+10+7+0)/3 = 7.3
How to let create a custom column to let the SQL know that I only want to divide by 3 instead of 5?