querying one row cell

Forum home » Delegate support and help forum » Microsoft Access Training and help » Querying one row with the cell in the previous row | Access forum

Querying one row with the cell in the previous row | Access forum

resolvedResolved · High Priority · Version 2003

Nicholas has attended:
Access Intermediate course

Querying one row with the cell in the previous row

How can this be done. It can be in Excel with a formula like =if(a1=a2,"Y","N")

RE: querying one row with the cell in the previous row

Hello Nicholas,

Hope you enjoyed your Microsoft Access Intermediate course with Best STL.

Your question is an interesting one, however, there may be several ways to do what you are asking. For me to be able to help you I will need more details... perhaps you can send me a sample table which you can send as an email attachment to info@stl-training.co.uk and mark for my attention.

I look forward to your response.

Have a great day.

Regards,

Rodney
Microsoft Office Specialist Trainer

RE: querying one row with the cell in the previous row

Hi Nicholas,

My name is Simon Khan and I am a trainer at Best Training.

My colleague passed on your question to me. I have just returned from holiday this morning and was wondering whether you could send me the excel file again with a detailed description of what you are trying to achieve as my colleague is training today.

Could you please send the file to sk@stl-training.co.uk.

Regards

Simon

RE: querying one row with the cell in the previous row

Hi Nicholas,

Just following up on my last email.

Is this question still active?

If it is could you please send me the spreadsheet to sk@stl-training.co.uk.

If not could you please mark it as resolved.

Regards

Simon

Will be marked as resolved in 5 days

Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.

RE: querying one row with the cell in the previous row

Hi, Yes this is still an active question and I still would like an answer. All I want to know is how can I compare the cell in one row in Access with the cell below it. This is a question regarding MS Access: I just referred to Excel because I know that a similar operation can be undertaken there.

I hope to hear from you soon

RE: querying one row with the cell in the previous row

Hi Nicholas, thanks for your question. The answer lies in the title of your own post - this has to be done using a query. Calculated columns are part of the meat and drink of an Excel spreadsheet, but it's very bad practice to try to do this to your database. Access 2010 allows you to add calculated columns to tables but this will result in a table that cannot be opened in previous versions of Access. It also contravenes the basic rules of normalisation and create big problems down the line.

So the answer is to create a query to display everything in a table, but to append a calculated column (created using the expression builder). The expression you need to create will take the form of a basic IIF expression, but the logical test you need to write will be the complicating factor. You need to test whether, say, the employee salary is greater than the salary of any field where the Employee Name is "CEO". The Expression Builder makes this a complicated thing to write and most database administrators would write this using raw SQL. Writing this for you is a bit beyond the scope of this forum, I'm afraid as is very dependent on the nature of your database but here's a basic introduction to calculated fields.

http://allenbrowne.com/casu-14.html

Hope this helps,

Anthony

Mon 9 May 2011: Automatically marked as resolved.

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

Changing MS Programs Text Size

A handy way to increase or decrease the size of text in Microsoft Word, Microsoft PowerPoint, Microsoft FrontPage, or Microsoft Publisher, first, select the text you want to resize.

Then, to increase the font size, press CTRL+SHIFT+>.

To decrease the font size, press CTRL+SHIFT+<.

View all Access hints and tips


Server loaded in 0.08 secs.