p_classic_2000
asked on
Calculate percentage
Hello,
I have a table "tbl2007_conference" with three fields, "NumberAttendees", "PresenterRating1" and "PresenterRating1_perc"
I'd like the percentage (PresenterRating1/NumberAt tendees x 100) to be automatically calculated in the "PresenterRating1_perc" field. Any help would be greatly appreciated.
Thanks!
I have a table "tbl2007_conference" with three fields, "NumberAttendees", "PresenterRating1" and "PresenterRating1_perc"
I'd like the percentage (PresenterRating1/NumberAt
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect, thanks rockiroads!
no probs
do think about not storing calculated values though, it may sound easy now but its more hassle than its worth
do think about not storing calculated values though, it may sound easy now but its more hassle than its worth
SELECT *, iif(NZ(NumerAttendees,0) = 0 , 0 ,100 * PresenterRating1/NumberAtt
From tbl2007_conference
The iif should prevent divide-by-zero errors if NumberAttendees is 0.