evaluate a field in the previous record

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]
 
J

John Vinson

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]
 
Joined
Apr 23, 2011
Messages
1
Reaction score
0
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top