I take This Week's Revenue and Last Week's Revenue values from the server and save them as: RevenueThisWeek = objRevenueThisWeek("REVENUE") RevenueLastWeek = objRevenueLastWeek("REVENUE") Then, I calculate percentage of them as: RevenuePercent = RevenueThisWeek - RevenueLastWeek RevenuePercent = RevenuePercent / RevenueLastWeek RevenuePercent = RevenuePercent * 100
Problem here is, if both RevenueThisWeek and RevenueLastWeek are 0, I receive the following error message.
Microsoft VBScript runtime error '800a0006'
Overflow
edit
Forgot to mention. I created an if statement as
If (RevenueThisWeek AND RevenueLastWeek) = "0" Then
Else
RevenuePercent = RevenueThisWeek - RevenueLastWeek
RevenuePercent = RevenuePercent / RevenueLastWeek
RevenuePercent = RevenuePercent * 100
End If
But this gave me results like:
Last Week This Week % Change
Revenue $49.99 $72.97 0%