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

Calc Total Time

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

    Calc Total Time

    I have a browse where you enter start time (character fields) and you enter end time. Then in another field total time worked is calculated using toseconds(). And naturally you can work more than one day on the project.

    I want to put a calculated field at the bottom of the browse that will "total" the total time worked for the project. Since the total time worked is a character field I can't get a total. So what do I need to do??

    Thank you
    Dan
    Dan

    Dan Blank builds Databases
    Skype: danblank

    #2
    RE: Calc Total Time

    Hi Dan

    Check the thread "TOTALLING TIME" up above. There are several responses which should help you figure out a solution.

    Robert

    Comment


      #3
      RE: Calc Total Time

      None of that applies to what I am asking.

      I want a calculated field on the form that total (sums) the calculations of many times that are calculated from various start and stop times. I have the formulas for the browse start and stop times worked out. No problem there. What I want is the Sum of all of those calculated times, in a calc field.

      Dan
      Dan

      Dan Blank builds Databases
      Skype: danblank

      Comment


        #4
        RE: Calc Total Time

        None of that applies to what I am asking.

        I want a calculated field on the form that total (sums) the calculations of many times that are calculated from various start and stop times. I have the formulas for the browse start and stop times worked out. No problem there. What I want is the Sum of all of those calculated times, in a calc field.

        Dan
        Dan

        Dan Blank builds Databases
        Skype: danblank

        Comment


          #5
          RE: Calc Total Time

          Dan,

          This may seem like an elementary question, but when you create the expresion using the calc field from the drop down list, did you try using the calculated field, which holds the total time, as the field to base the grand total on?

          kenn
          TYVM :) kenn

          Knowing what you can achieve will not become reality until you imagine and explore.

          Comment


            #6
            RE: Calc Total Time

            Dan,

            Here's what I did. I created a calc field to subtract the begin time from the end time to get the total time spent. The I created another calc field, in the expression box, I used the same expression as the other calc field, selected total and made sure advanced settings were set to Grand, which is the default setting.

            Works like a charm. tested it on tow separate calc fields.

            Here's the expression I used: (toseconds(endtime)-toseconds(begintime))/3600

            kenn
            TYVM :) kenn

            Knowing what you can achieve will not become reality until you imagine and explore.

            Comment


              #7
              RE: Calc Total Time

              Dan,

              If you are happy to have the time field a lookup list selection. My route for this problem is as follows.

              1. Create a timefield character.
              2. Create a timefill field numeric.
              3. Via field rules make timefield simple lookup list then choose add another column.
              4. Make the other column timefill field and add the numeric equivalents to character timefield.

              This way you can use timefield for data input and timefill field for the calculation.

              Michael

              Comment


                #8
                RE: Calc Total Time

                Michael,

                I re-read Dan's 1st post and missed the part about totaling by project. I see now where my answer is only part of the solution and that it would be necessary to incorporate a lookup. I studied your suggestion and I think he needs to use the lookup for the project so when he has a record with the project name showing, he has a field which displays the total hours for the project. I'm basing this on how I intrepret what he wants to do as I think he wants:

                1. A calc field will hold the total time for the day.
                2. He has another field which contains the project name.
                3. He wants another field to view the total time for project so, at a glance, he knows how much time has been expended.

                When he scoots through the browse he knows how much time has been expended on each project.

                Dan, is this what you have in mind? If not please elaborate a bit more.

                kenn
                TYVM :) kenn

                Knowing what you can achieve will not become reality until you imagine and explore.

                Comment


                  #9
                  RE: Calc Total Time

                  Hi Ken,

                  Thats sort of it. People will bring up their Project form based on the project they are working on. Enter their name, start time and end time. The time worked gets calculated -- all on the browse. Then on the bottom of the form I want to sum up the total time worked on that project.

                  Getting a calc field to sum a character field is where I'm stuck.

                  Dan
                  Dan

                  Dan Blank builds Databases
                  Skype: danblank

                  Comment


                    #10
                    RE: Calc Total Time

                    Dan,

                    I have a database with a child table that contains programs. There are only 8 programs so it's a bit easier. I have calc fields for each program that contain the amount for each program, each month. This is in a browse. I also have, on the form, calc fields for each program which keep a running total for each program. Basically, I think this is what you're after with the exception of the project names since there will be many more than 8, things will have to be done a bit differently.

                    How about this?

                    Your form can contain the fields such as the name of the person, date, Begin and End times for data entry. The Project Browse can contain the project name and a calc field for the total time. That way, you can see all projects at one time and you could even have another browse (Detail Browse) on the form which contains the date, begin & end times and total for the day. The browses should be read only. As you scroll through the project browse and click on a project, the detail hours for the project will show in the form and the Detail browse.

                    This is my expression for the program total (project total for you). It will have to be modified slightly for your situation.

                    total(iif(Issued->Pgrm="mfip",Issued->Amount_Ovr,0),GRP->MAIN_DATA)
                    I'm not sure how it would be re-written, perhaps like:

                    total(iif(Project="",Calc field,0),GRP->MAIN_DATA) (Actually, I think a script will need to be written, I don't know enough about this part of A5) Someone who is more adept at expression than I could lend a hand.

                    Form for data entry Project Total Browse
                    Project Total Project Hours
                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx bbbbbbbbbbbbbbbbbbbbbbb
                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx bbbbbbbbbbbbbbbbbbbbbbb
                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx bbbbbbbbbbbbbbbbbbbbbbb
                    Detail Browse Name date BeginTime EndTime Total for the date
                    ddddddddddddddddddddddddddddddbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                    dddddddddddddddddddddddddddddddbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
                    ddddddddddddddddddddddddddddddddbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

                    Hope this helps.

                    kenn
                    TYVM :) kenn

                    Knowing what you can achieve will not become reality until you imagine and explore.

                    Comment


                      #11
                      RE: Calc Total Time

                      Dan,

                      How is the time data entered?
                      Is it from a spin box choice such as 05:15, 05:30, 05:45?
                      Do the users type their own ie 1400, 1500?
                      Are the times dependent on minutes or are they rounded to 15 minutes, 30 minutes etc?

                      Michael

                      Comment


                        #12
                        RE: Calc Total Time

                        Hi Michael:

                        Time is entered as 2:22p. There is no lookup or spin box, and no rounding. Time is entered as they record it based on 60 minutes to the hour. They enter the time ending with an "a" for AM and "p" for PM. The time work field displays the calculated time as 0:58 or 2:44, whatever is appropriate.

                        Thanks:
                        Dan
                        Dan

                        Dan Blank builds Databases
                        Skype: danblank

                        Comment


                          #13
                          RE: Calc Total Time

                          Dan,

                          This is how I would approach your problem at first try and it should only accept accurate data from your users whereas at present your users could easily enter a p instead of an a etc..

                          1. I would create four fields HOURS Character, HOURSFILL numeric, and MINS Character, MINSFILL numeric
                          2. Via field rules, I would make HOURS a simple list lookup with values 0 to 24 incrementing 1 then in the same field rule window I would add another column and I choose HOURSFILL as the field. The hours fill would would be the same as the HOURS list. Now whenever your user enters hours from the spinbox list the HOURSFILL will contain a numeric equivalent that is a virtual numeric field and can be used for calculation and there is no fear of your user entering obscure data.

                          3. I would do the same for MINS and MINSFILL but build the lookup list from 0 to 60 or if you could reduce the size if an increment of 5 or ten minutes woul be acceptable. You will then have a virtual numeric MINSFILL field for your calculations.

                          4. It would be easier if the time was acceptable in say 15 minute increments then you could base this method on only two fields HOURS Character and HOURSFILL numeric. You would then have a lookup of 09:15, 09:30, 09:45, 10:00. Your HOURSFILL fields will benumeric 9.25, 9.5, 9.75, 10.00. Your user will always enter accurate data this way and the numeric fields would be completely out of sight.

                          There are obviously other ways but I use this method often to work out hours worked etc.

                          Hope this helps

                          Michael

                          Comment


                            #14
                            RE: Calc Total Time

                            Look at the attached sample.
                            The field rule for total_time is:
                            RIGHT("0"+TOTIME(TOTAL_SEC,1,0),5)
                            The expression for the form's summary field is:
                            TOTIME(TOTAL(TOSECONDS(Projtime->Total_Time)),1,0)

                            Comment


                              #15
                              RE: Calc Total Time

                              This sample app handles times that cross the midnight hour.

                              Comment

                              Working...
                              X