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

Time calculation display as negative...

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

    #16
    hmmm - i tried to calc from Romy in the HOURS calc(vy) and also placed it within the field rules of the field HRS - and darned if it doesn't appear correct on all issues that you had described Stan...

    FYI - I did remember to re-apply the calcs etc -
    Just in case I went and re-typed the Am/Pm in...

    Could this be all that was in error?

    Thanx
    George

    Comment


      #17
      it is lot of possibility.
      Last edited by Romy Huang; 04-27-2006, 11:22 AM.
      :) Romy

      Comment


        #18
        assume use variable firsttime, secondtime
        1) both am or pm.
        secondtime>firsttime, then use secondtime-firsttime
        secondtime<=firsttime, then use 24-firsttime+secondtime

        2) firsttime is am and secondtime is pm, use secondtime-firsttime

        3) firsttime is pm and secondtime is am, use 24-firsttime+secondtime
        :) Romy

        Comment


          #19
          Code:
          round(if(TOSECONDS(Inv_Test->Hrout)>TOSECONDS(Inv_Test->Hrin),(TOSECONDS(Inv_Test->Hrout)-TOSECONDS(Inv_Test->Hrin))/3600,TOSECONDS("24:00")-TOSECONDS(Inv_Test->Hrin)+TOSECONDS(Inv_Test->Hrout))/3600),2)
          for example:
          f1="8:00am"
          e1="10:00am"
          ?TOSECONDS(e1)>TOSECONDS(f1)
          = .T.
          ?(TOSECONDS(e1)-TOSECONDS(f1))/3600
          = 2.000000


          f1="8:00am"
          e1="7:00am"
          ?TOSECONDS(e1)>TOSECONDS(f1)
          = .F.
          ?(TOSECONDS("24:00")-TOSECONDS(f1)+TOSECONDS(e1))/3600
          = 23.000000

          f1="8:00pm"
          e1="2:00am"
          ?TOSECONDS(e1)>TOSECONDS(f1)
          = .F.
          ?(TOSECONDS("24:00")-TOSECONDS(f1)+TOSECONDS(e1))/3600
          = 6.000000
          Last edited by AaronBBrown; 06-06-2006, 05:15 PM.
          :) Romy

          Comment


            #20
            Originally posted by czar_g
            hmmm - i tried to calc from Romy in the HOURS calc(vy) and also placed it within the field rules of the field HRS - and darned if it doesn't appear correct on all issues that you had described Stan...

            FYI - I did remember to re-apply the calcs etc -
            Just in case I went and re-typed the Am/Pm in...

            Could this be all that was in error?

            Thanx
            George
            How about a different approach forcing the user to make the correct am/pm entry?

            Try my attachment and some data entry. The hours field rule calculation expression has been reset to your original. Upon navigating to a new row a message pops up and notifies the user if the hours calculation would result in a negative value. Cancels the row change and places the user back in the hours in column of the browse to retry.
            There can be only one.

            Comment


              #21
              Originally posted by Stan Mathews
              How about a different approach forcing the user to make the correct am/pm entry?

              Try my attachment and some data entry. The hours field rule calculation expression has been reset to your original. Upon navigating to a new row a message pops up and notifies the user if the hours calculation would result in a negative value. Cancels the row change and places the user back in the hours in column of the browse to retry.
              This is a good thing -

              However there are occasions that a driver will report at 8PM and stay until the wee hours of the morning 2AM... in this case.

              I wish I was more knowledgable about what Romy had tried to communicate.
              Its all greek - kinda/sorta. I know enough to be dangerous.. ;)

              george

              Comment


                #22
                Originally posted by czar_g
                However there are occasions that a driver will report at 8PM and stay until the wee hours of the morning 2AM... in this case.
                george
                Then you really need to store the date as well as the time and include that in the calculation.
                There can be only one.

                Comment


                  #23
                  OK -

                  The date is another field that they do place when the instance occurs..
                  They do so many other things that relate for TIME - trucking company.
                  This one instance which they call "hourly" is the only time this occurs.
                  AM/PM - PM/AM -

                  Was there the otherday and she just asked why are these number showing negative amounts? which lead to this message on the board.

                  If I could figure this variable thing out that Romy was talkin about - thats kewl. At least I think I have a band-aid so that her numbers don't appear negative -

                  Maybe they will hire me full time and I could play with Alpha a little more.
                  WOW and then ya'll would see me more often - LOL

                  thnx
                  george

                  Comment


                    #24
                    I use f1 as start time, e1 as end time.

                    if e1 is any time after f1 befor 12:00 midnight, toseconds(e1) > toseconds(f1) will be true, SO the calculate (toseconds(e1)-toseconds(f1))/3600 will work
                    if e1 is any time after 12:00midnight before f1 of next day, toseconds(e1) <= toseconds(f1) will be true, so the calculate (toseconds("24:00")-toseconds(f1)+toseconds(e1))/3600 will work
                    Last edited by Romy Huang; 04-27-2006, 03:43 PM.
                    :) Romy

                    Comment


                      #25
                      I think this calc seems to work.

                      Code:
                      if(round((TOSECONDS(Inv_Test->Hrout)-TOSECONDS(Inv_Test->Hrin))/3600,2)>=0,round((TOSECONDS(Inv_Test->Hrout)-TOSECONDS(Inv_Test->Hrin))/3600,2),round((TOSECONDS(Inv_Test->Hrout)-TOSECONDS(Inv_Test->Hrin))/3600,2)+24)


                      Edit: I was going through the new posts after a couple of days and didn't got to the end of this thread properly to see that it had been resolved. Sorry.
                      This does almost the same as Romy's. It adds 24 to compensate for the negative number (not 12;) )
                      Last edited by Tim Kiebert; 04-30-2006, 01:45 AM.
                      Tim Kiebert
                      Eagle Creek Citrus
                      A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                      Comment


                        #26
                        Hello - it's me again..

                        I thank you for your help - really -
                        I had changed the HOURLY form to calculate correctly and compensate for the 24hrs - PM/AM - AM/PM - PMPM - AM/AM.

                        Now 2 months into them using another form they just realized that PM to AM calculation is not working within the ASPHALT form. I have tried to use the various formulas in this post - all to no avail.

                        The form is GE Asphalt Form.
                        If you enter in Tons & Ton Rate - No problem
                        If you add a plantin/plantout time and it is AM to PM it works No problem.

                        BUT

                        If you add a plantin/plantout time and it is PM to AM it DOES NOT work at all. It totally ignores the time and just calcs along with just the ton/ton rate.

                        the different times in the form represent the different occasion a driver may charge if his truck waits to long. He could have no time or all 3....

                        Would someone be so kind as to look at my calcs and see where I may be fouling up?

                        thanx
                        `george

                        Comment


                          #27
                          Hello

                          Not sure where to look - I am still having the issue.

                          The folks have circumvented the calc by just swapping the AM/PM but that does not show true and will have to be addressed later. When they go to view history on a driver/job it'll display AM- start (when actually it was PM).

                          Is there any help?

                          Regards
                          George

                          Comment


                            #28
                            Hi George,
                            Not much you can do if your users won't pay attention. Perhaps you could annoy them a little to get their attention with a CanDepart event for the field that forces them to confirm their data entry is correct. Add a ui_beep() and make them click OK to continue.
                            Robin

                            Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                            Comment


                              #29
                              Originally posted by MoGrace
                              Hi George,
                              Not much you can do if your users won't pay attention. Perhaps you could annoy them a little to get their attention with a CanDepart event for the field that forces them to confirm their data entry is correct. Add a ui_beep() and make them click OK to continue.
                              No don't misunderstand -

                              The time calculations on this screen can be AM/PM or PM/AM..
                              The screen displays correctly if they just put AM/AM or AM/PM calculations.
                              The hours calc out correctly - so right know they are entering revese times so that the hours calc correctly.

                              ie.
                              A driver works from 10:00 PM until 2:00 AM which equals 4 hours.
                              At this point if they enter 10PM and 2AM it doesn't calculate ANYTHING (zero, squatola). So to get around this issue until I can figure out WHY they enter 10:00 AM and 2:00 PM so that it calculates correctly.

                              I have tried a hundred different calcs in order to have this calculate correctly and have run out of options - I am preverbially stumped.

                              The ZIP file in a previous post shows the calculation in action and I was hoping someone could look at it and say - AHA here's why it isn't working..

                              But I don't guess thats gonna happen.

                              Thanx for your help.
                              George

                              Comment


                                #30
                                Try this

                                I used Romy's idea from above to get this:


                                Code:
                                if(toseconds(Outime)>toseconds(Intime),if(((toseconds(Outime)-toseconds(Intime))/60)-30<0,0,((toseconds(Outime)-toseconds(Intime))/60)-30),if(((toseconds("24:00")+toseconds(Outime)-toseconds(Intime))/60)-30<0,0,((toseconds("24:00")+toseconds(Outime)-toseconds(Intime))/60)-30))
                                The same is laid out below so you don't have to scroll to see the whole thing.
                                Code:
                                [COLOR="Red"]if(toseconds(Outime)>toseconds(Intime),[/COLOR]
                                    [COLOR="Green"]if(((toseconds(Outime)-toseconds(Intime))/60)-30<0,
                                          0,
                                          ((toseconds(Outime)-toseconds(Intime))/60)-30
                                      )[/COLOR][COLOR="Red"],[/COLOR]
                                    [COLOR="Blue"]if(((toseconds("24:00")+toseconds(Outime)-toseconds(Intime))/60)-30<0,
                                          0,
                                          ((toseconds("24:00")+toseconds(Outime)-toseconds(Intime))/60)-30
                                      )[/COLOR]
                                  [COLOR="Red"])[/COLOR]
                                Last edited by Tim Kiebert; 06-12-2006, 08:05 PM.
                                Tim Kiebert
                                Eagle Creek Citrus
                                A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                                Comment

                                Working...
                                X