November 24, 200619 yr Newbies I am new to the forum and I am trying to set up a calculation where I enter the current hour meter reading and it will display the hours run since the last record's current reading. How can I reference the previous record's entry? Thanks Nverted
November 26, 200619 yr [Read the last bit first] I think there might be a built in function for this but I experimented to see if a relationship would work. It does. You need two calculation fields, result Number: RecID Get ( RecordID ) and PrevRecID Get ( RecordID ) - 1 and then just create a relationship based on those two (I got it the wrong way round at first). As record IDs are allocated in record creation order then this would give you access to all the fields in the previous record. If you replace the - 1 with a '- ' it could make the data to any previous record available in the current record. What happens if the previous record got deleted? What happens if the previous record is blank? Experimented some more and there is an easier way without the need to create a relationship. Just use this: Prev Reading GetNthRecord ( Meter Reading; Get ( RecordID ) - 1) I'd read about GetNthRecord but didn't understand it till your question got me to use it. Thanks, Norman
Create an account or sign in to comment