querying one row cell
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

Querying one row with the cell in the previous row

resolvedResolved · High Priority · Version 2003

replyReply Fri 17 Dec 2010, 16:21Delegate Nicholas said...

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")

For upcoming training course dates see: Pricing & availability

replyReply Thu 23 Dec 2010, 09:16Trainer Rodney said...

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 and mark for my attention.

I look forward to your response.

Have a great day.

Regards,

Rodney
Microsoft Office Specialist Trainer

replyReply Thu 6 Jan 2011, 09:35Trainer Simon said...

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.

Regards

Simon

replyReply Wed 20 Apr 2011, 13:51Trainer Simon said...

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.

If not could you please mark it as resolved.

Regards

Simon

replyReply Wed 27 Apr 2011, 11:26Trainer Richard said...

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.

replyReply Tue 3 May 2011, 10:10Delegate Nicholas said...

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

replyReply Tue 3 May 2011, 15:14Trainer Anthony said...

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.

 

Please browse our web site to find out more about
access/courses and other Microsoft training courses.

Access tip:

Display current date & time in column of any width

The worksheet function =NOW() returns the current date & time. When entered into a column which is not wide enough to display the value NOW returns, the cell displays ###

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard