November 24, 200421 yr Hi What I want to do: Database for keeping track of electricity use. So take start reading take end reading en use the outcome of end reading - start reading. The following day I create a new record and the start reading is the end reading from the previous day. But I do not seem to get it working! I can use the option value from previous record but that is the same field and not the value of the end reading field from the previous record. can someone give me a direction to find a sollution for this? thanks! emma
November 24, 200421 yr Here's one solution: Assuming you have a CustomerID field in there (to distingush between different customer's readings,) create a self join relationship: ReadingSelfJoin= Reading::CustomerID = Reading::CustomerID sort the relationship by StartReadingDate, decending. Now make the StartReadingDate a lookup = ReadingSelfJoin::EndReadingDate
November 28, 200421 yr Author First at all thanks! But it is not working for me. Adding a second record works great but as soon I start the third record it takes the value of record is it possible that you make a small setup or have a look at my file? thanks a lot! emma
November 28, 200421 yr Enclosed is a simple example. When you create a new record for an existing ID, it auto enters the end date from the latest record. AutoEnterExample.fp5.zip
November 28, 200421 yr I am attaching a file originated by John Mark Osborne and modified by me. John Mark & exchanged e-mails about which was correct. Neither of us concided. You can download the original from his site. LULAST.FP5.zip
November 28, 200421 yr Hey Ralph, I can see how your solution works when the file has only one customer's records, but I think it would need some modification to work for multiple customers (though it is not clear if emma needs it to work for multiple customers.) I would also be concerned about the possibility of an entry being made out of order.
November 28, 200421 yr The problem I see with you method is re-lookups. If you need to make a change the re-lookup would put the same value in all the records for a customer.
November 28, 200421 yr Good point. Then how about using the same self-join, but use an auto-entered calc instead of the Lookup: Start Date (date, auto-enter calc) = SelfJoin::EndDate
Create an account or sign in to comment