7 Replies Latest reply on Aug 4, 2012 12:27 PM by EricaJackson

    Start and stop times

    EricaJackson

      Title

      Start and stop times

      Post

      Hello. I am trying to make a "time clock" so to speak. I need to have start time and stop time in the same record. I have been able to create the start time using the creation time but I would like to make a button to auto enter the stop time instead of having to type in the time. Creation time doesn't work and neither does modification times, they enter the same time as the start time. What is the difference between them anyway? I found a drop down calendar but is there a clock function for the time field? Thanks for the help.

        • 1. Re: Start and stop times
          philmodjunk

          Modification Time will record the time the record was last modified. If you define a text field and then two time fields: one that auto-enters the creation time and one that auto-enters the modification time, you'll see that creating a new record enters the exact same time in both fields, but if you then come back later and edit the text field by entering data in it, the modifcation time will change, but the creation time will not.

          I'd use buttons for entering the current time:

          Set Field [YourTable::YourTimeField ; Get ( CurrentTime ) ]

          If there is any chance that the start time will come before midnight and the end time will come after midnight, use timestamp fields that enter the date and the time instead of just the time.

          Set Field [YourTable::YourTimeStampField ; Get ( CurrentTimeStamp ) ]

          • 2. Re: Start and stop times
            EricaJackson

            Thanks! I didn't think about after midnight and would be a problem so I will use timestamps from now on.  Now I need to add the times together for the records created for that person on that date. I tried a summary field but it adds all of the records, not just the specific date of records. How would I set up a field for that?

            • 3. Re: Start and stop times
              philmodjunk

              You'll need to describe what you want in more detail.

              Do you mean the elapsed time? (TimeStampEnd - TimeStampStart)

              Do you want a total for each day that totals up several records for each day?

              Do you need to see the individual records or just the daily totals?

              A summary field can do all of the above with the correct set up, but it's not the only option.

              • 4. Re: Start and stop times
                EricaJackson

                I have this set up in a portal, I have a calcualtion field ( Stop - Start) to calculate the minutes for the record ( I will go back and change this with the Timestamps instead) but then I would like to be able to add minutes of the records together for that specific date.

                date 7/21  start  3:15pm  stop 4:30pm     45 min

                date 7/21  start  5:20Pm  stop 6:00pm     40 min                   85min

                date 7/05  start  2:25pm  stop  3:15pm    50 min

                date 7/05  start  10:00am  stop 11:30pm  90 min                  140 minutes

                 

                the summary field I have adds all of the records together        225 minutes

                also is there a way to turn the portal so the records are displayed vertically instead of horizontally?

                 

                • 5. Re: Start and stop times
                  philmodjunk

                  If you used a summary report layout instead of a portal, you could add a sub summary layout part and place the summary field in this layout part. you'd set the sub summary part to have "when sorted by" date and sort your records by date.

                  In a portal, this could be done, but you'd need to add a "self join" relationship That links these records to themselves by the date field. Then a calculation field with Sum (SelfJoinTableOccurrenceHere::ElapsedTime ) could be placed in the portal row to show the daily total.

                  To get a "horizontal portal", you can place a row of one row portals side by side in your layout. Set the first portal with "initial row 1" , the second with "initial row 2" and so forth. You can resize the portal row height so that you can place several fields from the same portal record one above the other in the same portal row.

                  • 6. Re: Start and stop times
                    EricaJackson

                    Thanks! I will give it a try.

                    • 7. Re: Start and stop times
                      EricaJackson

                      Thank you Phil! I was able to get it done!