By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,725 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Returns The Previous Record's Value In Another Field In A Query

P: n/a
Does any anyone have a procedure for a query where a calculated field returns
the previous record's value in another field. For example:

A
F A
Z F
M Z

The primary key is in random order in the query and the letters ar not sorted.

Thanks,

Steve
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
There is no "previous" record in Access. Consider all records as random
ordered unless you have a value to order them by.

--
Duane Hookom
MS Access MVP
"Steve" <sa****@penn.com> wrote in message
news:Dm******************@newsread3.news.atl.earth link.net...
Does any anyone have a procedure for a query where a calculated field returns the previous record's value in another field. For example:

A
F A
Z F
M Z

The primary key is in random order in the query and the letters ar not sorted.
Thanks,

Steve

Nov 12 '05 #2

P: n/a
On Tue, 20 Jan 2004 04:44:19 GMT, "Steve" <sa****@penn.com> wrote:

Others may prove me wrong, but I think the Pk has to be sorted for a
query to work. I see this shaping up as a subquery. Something like:
select MyTable.PKValue, select PKValue from MyTable B where B.PKValue
< A.PKValue
from MyTable A
However, < only works if sorted. I think.
If you have to do it your way, I'd consider a recordset approach
rather than a sqlstatement.

-Tom.
Does any anyone have a procedure for a query where a calculated field returns
the previous record's value in another field. For example:

A
F A
Z F
M Z

The primary key is in random order in the query and the letters ar not sorted.

Thanks,

Steve


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.