evaluate a field in the previous record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a calculated field in a query that evaluates a field in the previous
record and returns a result when compared to that same field in the current
record:

IIF([value of field A of the previous record]=[value of field A of the
current record], [field B], [field C]
 
I need a calculated field in a query that evaluates a field in the previous
record and returns a result when compared to that same field in the current
record:

IIF([value of field A of the previous record]=[value of field A of the
current record], [field B], [field C]

An Access table does not *HAVE* "previous" or "next" records. It's an
unordered "heap" of data. As such, your question has no meaning.

What constitutes the "previous" record? Do you have some timestamp or
sequential ID that would allow you to find that record?

I'm VERY queasy about your table design; the value of a field in a
record should depend ONLY upon the primary key of that record, not
upon values of any other field in that record or of any other record.
Could you explain the real-world problem you're trying to model?

John W. Vinson[MVP]
 
You, John W. Vinson [MVP], are an @55 h0Le !!!!
You don't deserve to be "MVP" of anything and I hope that if you get any queasier you choke on your vomit.

Guest with the very odd name who asked the question - you will find the answer to your question explained on Microsoft's support page located here:
http://support.microsoft.com/kb/210504

DLookUp("[MyField]","MyTable","[ID]=" & [ID]-1)
 
Back
Top