I have 2 attributes, Pickup and Arrival. Both are timestamp fields. They have BOTH been computed previously. For example, pickup 9:00 AM, arrival 9:45AM. Now the user wants to enter a new pickup time and I need to change the arrival time by the DELTA of the original pickup time and the new one. So if they enter, 9:20 pickup time, I need to add 20 minutes to the arrival.
Not sure how to code that in aware
Bruce
Time Math -- Easy in SQL what about in Aware?
Re: Time Math -- Easy in SQL what about in Aware?
Out of curiosity, how would you do that in SQL?
Bob
Re: Time Math -- Easy in SQL what about in Aware?
Here is one idea that I tested, and it works:
First create a duration attribute called duration.
Activate this update rule:
Set it to:
Dynamic
Do not run on server
Form initialization: No
Came up with this in a few minutes so it might need some improvements.
First create a duration attribute called duration.
Activate this update rule:
Code: Select all
If BO.Pickup WAS CHANGED AND NOT(BO IS NEW) Then
BO.duration=BO.Pickup-OLD_VALUE(BO.Pickup)
BO.Arrival=BO.Arrival+BO.duration
Dynamic
Do not run on server
Form initialization: No
Came up with this in a few minutes so it might need some improvements.
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: Time Math -- Easy in SQL what about in Aware?
Adding to a timestamp gives you another timestamp. Adding 1 means adding 1 hour. Adding 0.5 means adding 30 min.
Aware IM Support Team