Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 278847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:18:14+00:00 2026-05-12T01:18:14+00:00

I take This Week’s Revenue and Last Week’s Revenue values from the server and

  • 0

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%
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T01:18:14+00:00Added an answer on May 12, 2026 at 1:18 am
    RevenuePercent = RevenueThisWeek - RevenueLastWeek
    If RevenueLastWeek >= .01 Then '1 cent minimum. >0 can get messy.'
       RevenuePercent = RevenuePercent / RevenueLastWeek
    Else
       RevenuePercent = 0
    End If
    RevenuePercent = RevenuePercent * 100   
    

    Why the >.01?

    VBScript doesn’t have a decimal type and defaults to floats which means you could end up with a value of .0000004505 or something ugly which will still result in an overflow. If you deal with tenths of a cent change it to

    If RevenueLastWeek >= .001 Then
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Last week I took a dump of my subversion server. This week I mistakenly
Take this query: SELECT * FROM MyTable WHERE MyColumn = 'SomeValue' ORDER BY SomeFakeQualifier.MyColumn
I made the following function in SQL Server 2008 earlier this week that takes
How could I take a mysql query like this: SELECT id,title,timestamp,upvotes,downvotes,views FROM {$table} ORDER
It will take up to 4.5 sec on a fast server to make this
Take this example: {-# OPTIONS_HADDOCK ignore-exports #-} module HaddockTest (e1) where -- * Exported
Take this Lorem Ipsum text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla
Take this example code (ignore it being horribly inefficient for the moment) let listToString
Take this sample class as an example: [AttributeUsage(AttributeTargets.All, AllowMultiple=true)] public class BugFixAttribute : System.Attribute
Take this code into consideration: Proxy p = new Proxy(Type.SOCKS, new InetSocketAddress(proxyURL, port)); try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.