Link to home
Start Free TrialLog in
Avatar of quanmac
quanmac

asked on

Database Function Formula

Hi There,

I've been staring at this for some time and I can't figure out why I'm getting 0.000 for an answer.

I've tested my other code in my function and they are working great, it's just when I try to calculate my rating, it keeps returning 0.00.

I've gotten 578 for @TotalAttended and 2 for @TotalAcceptedRefunds, using the formula below, I should be getting back: 0.9965

PRINT @TotalAttended
PRINT @TotalAcceptedRefunds

/* Return 0, if there are no participants that have attended the course */
IF @TotalAttended > 0
     SET @Rating =  (@TotalAttended - @TotalAcceptedRefunds)/@TotalAttended
      
PRINT @Rating

Anyone got an idea, what is wrong with my formula?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial