Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Form calc display field not working correctly

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Form calc display field not working correctly

    Subject: Form calc display field not working correctly

    I have a calculated display field on a form that doesn�t seem to be working correctly and I am wondering if I�m whacked in missing something simple, or what!?!?!? I would greatly appreciate your help & input.

    Among others, the table has the following fields:
    1) CHKAMNT
    2) FICA
    3) FED_WITH
    4) STATE_WITH
    5) GROSS_PAY

    Calc field (display field only, not table field) has the following programming: IF(CHKAMNTGROSS_PAY-FICA-FED_WITH-STATE_WITH,�NOT BALANCED�,��)

    The calculated field displays NOT BALANCED with the following information.

    1) 337.02
    2) 31.78
    3) 35.36
    4) 11.31
    5) 415.47
    calc field: NOT BALANCED

    I have done the math over & over, and the math above is correct. (Please tell me so.) Most records display correctly, however, there are a number of records where if I do the math, a NOT BALANCED is displayed when in fact I go in using a calculator and everything adds up correctly but the NOT BALANCED is still displayed.

    Is this a bug, or am I the bug?

    Thanks,
    Mike
    Thank you,
    Mike Konoff

    #2
    RE: Form calc display field not working correctly

    Mike,

    Call me crazy, but I never liked multople subtractions. I would , instead use the following:

    if(chkamt gross_pay - (fica+fed_with+state_with),"Not Balanced")

    Check to make sure that all fields are numeric with proper decimal alignment. If fica and other witholdings are calculated, check # of decimal positions. When you do the calcs, rounding can kill you. You may want to force rounding to 2 decimal positions for each field. What I have found is that if you calculate Fica, it is some obscure percentage that calculateds to more than 2 decimal positions, then your calc is blown.

    TOm

    Comment


      #3
      RE: Form calc display field not working correctly

      Mike, are any of the values (i.e., FICA) a result of using a percentage or other calculation that could result in an answer that would have more than 2 decimal places? For example, if the FICA is 12.378 (which the program would round to 12.38), could this be giving you the error? One way to find out would be to increase the number of decimal places in the fields, and see if the result really IS "not balanced".

      Comment


        #4
        RE: Form calc display field not working correctly

        In a prior thread "Wierd math side effect" adding or subtracting certain fractionl amts caused what I believe you are seeing. Using the intereactive window:

        dim h1 as n
        dim h2 as n
        h1 = 12.42
        h2 = 3.33 + .55 + .33 + 8 + .21
        ?h1 = h2
        = .F.
        ?abs(h1-h2)

        Comment


          #5
          RE: Form calc display field not working correctly

          In my attempt to automate some of my accounting I have simply made a Check Register where all information is hand entered, for now, as opposed to how it used to be done...all by hand into columnar pad spreadsheet.

          Thomas, I will give your suggestion a shot and see what results.

          Thanks,
          Mike
          Thank you,
          Mike Konoff

          Comment


            #6
            RE: Form calc display field not working correctly

            In my attempt to automate some of my accounting I have simply made a Check Register where all information is hand entered, for now, as opposed to how it used to be done...all by hand into columnar pad spreadsheet.

            Thomas, I will give your suggestion a shot and see what results.

            Thanks,
            Mike
            Thank you,
            Mike Konoff

            Comment


              #7
              RE: Form calc display field not working correctly

              Sorry about the above repost...don't know how I did that.

              I should have added, none of the information that I'm inputting is derived from any calculation. All information is read from checkbook and re-entered into the database.

              Thanks again,
              Mike
              Thank you,
              Mike Konoff

              Comment


                #8
                RE: Form calc display field not working correctly

                Mike,

                Just for kicks, try this in the A5 Interactive window

                c=337.02
                f=31.78
                d=35.36
                s=11.31
                g=415.47
                j=g-c-f-d-s

                ?j*10000000000000


                Let me know what you get. This points to why you are having the problem. It does not, however solve it.

                Regards,


                Jay Talbott
                Jay Talbott
                Lexington, KY

                Comment


                  #9
                  RE: Form calc display field not working correctly

                  Mike,

                  your expression is:
                  IF(CHKAMNTGROSS_PAY-FICA-FED_WITH-STATE_WITH,�NOT BALANCED�,��)


                  Try this instead:

                  IF(round(chkamnt,2)round(Gross_pay - Fica - Fed_With - State_With,2),"Not Balanced","")

                  -- tom

                  Comment


                    #10
                    RE: Form calc display field not working correctly

                    Jay,

                    After entering your suggestion into the interactive window, I am returned the following: 0.444089

                    What does this suggest. Someone asked if any of the information is derived from calculations. None are. All values are manually inputed, which is what really suprises me.

                    Would like to hear what you think. Thanks for your help.

                    Mike
                    Thank you,
                    Mike Konoff

                    Comment


                      #11
                      RE: Form calc display field not working correctly

                      Tom,

                      Your suggestion proved to be a workable solution. The equation now works.

                      However, I am a bit perplexed because all concerned field structures are N, 10, 2. All values are entered by hand. And, it's simple math that determines if the fields match. There should be no reason any value above & beyond 2 decimal places accumulates anywhere.

                      What do you think or suspect?

                      Thanks for your help.

                      Mike
                      Thank you,
                      Mike Konoff

                      Comment


                        #12
                        RE: Form calc display field not working correctly

                        Mike, my guess is that one or more of the subtractions resulted in a difference value that could not be completely represented with only two decimals. As others have explained (in other threads on this board), there are some numbers which make sense in our base 10 decimal system, which cannot ever be represented by an exact combinatation of zeros and ones in the computer's binary system.

                        Rather than discard the 'extra' decimals, Alpha Five carried them forward into the next subtraction. The final result included them, even though the 'displayed' value had only two decimals.

                        The key here, at least for me, is remembering that the value displayed on screen is not necessarily a complete representation of the actual value Alpha Five has computed in memory.

                        -- tom

                        Comment


                          #13
                          RE: Form calc display field not working correctly

                          I believe Tom has hit the nail on the head, but it's not just an Alpha situation here. If you go to Excel and put the following formula into a cell:
                          =3.33 + .55 + .33 + 8 + .21 -12.42 = 0
                          It should evaluate as true, however, it evaluates to false for the reasons Tom talked about.

                          Comment

                          Working...
                          X