First off: I'm a Microsoft SQL and Access developer so my approach to solving this problem is very different.
I have the following problem: I need to record a persons weight over time. However I also need to display the weight loss from the previous weighing. How would you do this?
I have put some rules in place but AwarIM's rules seem to be tripping over each other. The idea would be to record on every weighing the date taken AND the previous weigh date. That way one can look up the previous weight to compare it and determine what was lost. I'm having trouble creating a rule that FIND's the previous record for a Client where the Datetaken is less than the one being entered. I've tried various combinations but it seems not to like do a query on itself.
Here is a sample of one of the many ways I tried this so you can get the idea maybe:
If Weight.dt_DateTaken IS DEFINED Then Weight.dt_LastWeighed=MAX Weight.dt_DateTaken WHERE (Weight.ref_Contact.ID=Weight.ref_Contact.ID AND Weight.dt_DateTaken<Weight.dt_DateTaken)
Criteria should be last weight records date for this client where the date is smaller than the current record being entered. Remember you cant use CURRENT_DATE as these records can be edited later and need to update!
Tx