1 Reply Latest reply on Nov 15, 2010 3:04 AM by LaRetta_1

    Updating a calculation



      Updating a calculation



      I have made a "sign-in" database where firefighters sign in and sign out as they leave headquarters.

      One of the admin pages I have shows the current members signed in, and how long they have been signed in for. I created a field called CurrentHours, and then used a calculation in the field to show the number of hours the member has been at headquarters:

      Round ( (((Get(CurrentTimeStamp) - SignInTime))/3600) ; 1 )

      However, when I visit the layout with the CurrentHours shown for the first time, it seems to calculate, but if I come back an hour later, the calculations don't update.

      Is there a way to refresh the calculations (or auto-refresh every minute) so the CurrentHours field remains accurate?


        • 1. Re: Updating a calculation

          Your SignInTime really should be a timestamp as well; don't firefighters work overnight?  Then a calculation (result is time) would be:

          Get ( CurrentTimeStamp ) - SignInTime

          In the calculation box, then go to Storage Options (bottom right) and check 'do not store calculation results...' so it will update whenever that layout is viewed.  This is important with most Get() functions; they must be unstored to update.

          To format the display of time, handle that from your layout itself (Inspector > Data tab and select at the bottom Data formatting (and the clock) and specify displaying hours, minutes as you wish. :^)