1 Reply Latest reply on Jan 14, 2009 1:02 PM by ninja

    get data from last record



      get data from last record




      I have a need to retrieve data into a field from the last record in a DB. The DB has serveral use accounts and I need to get a piece of data from the last record of the logged in user only. I thought of perhaps using Get ( RecordNumber ) - 1 or GetNth but still I need to limit the result to records within one user only an the numbers then don't match up. 

        • 1. Re: get data from last record

          Howdy gsainc,


          depending on "record numbers" is a very dangerous thing since they change through found sets and sorts.  If there is any other way to ID the record I would use it instead.


          I'm unclear as to which record you need info on.  If it is just the last record a given user browses, could you perhaps use a script that automatically runs on closing the Dbase?


          If by "last" you actually mean "previous", you could timestamp the records, automark each record with accountname, find by accountName and sort by timestamp immediately prior to your data reference...this would take away the uncertainty of where you were getting your data from.  At that point, you'd also be working within a found set of records for that particular user so if you wanted to use the Get(RecNum)-1, it should be OK.