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

Compare Fields across records

P: 2
Is there a method using MS Access that I can compare a field on one record to the same field in a subsequent record.

For example, if I have a query that has three fields and four rows as follows

Cost_Centre, Account, Month
110 2200 Jan
110 2200 Jan
101 2200 Feb
101 2200 Feb

Is it possible to compare the month fields by record and populate a fourth field? For instance, is it possible to write a calculated column that says if the month in row 2 = the month in row 1 then Y, Else N? I would be looking for a result similar to the following

Cost_Centre, Account, Month, Flag
110 2200 Jan N
110 2200 Jan Y
101 2200 Feb N
101 2200 Feb Y

Thanks

Loki
Dec 29 '06 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,660
Essentially No.
The power of an RDBMS is fundamentally connected with it's ability to process large numbers of records individually.
It can group and filter and all sorts of other clever things, but it can't start comparing records in the way you require.

You need to ask yourself - What do I actually want?
It could be that there is a sensible way to achieve the required results without trying to compare records to other, unconnected, records.
Dec 31 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.