Solved

Access 2007 query

Posted on 2013-01-30
5
257 Views
Last Modified: 2013-01-31
Good day everyone. I have a dilemma. I have a query that I am attempting to construct in Access 2007. It has a unique id and 5 different values for 5 different years.

What I want to do is write the query where is all 5 values are the same value, do not include.

How can this be done?
0
Comment
Question by:mig1980
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 38837567
An example would be helpful :)
0
 

Author Comment

by:mig1980
ID: 38837584
Here is an example as data attached.

In this example the query I am trying to construct would all columns in  ID 6344, 6754, 5986, and 5846 as the other two ID have all the same values in all 5 year columns.
Book1.xlsx
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 300 total points
ID: 38837652
You could do it with boolean logic in a WHERE clause:

SELECT *
FROM SomeTable
WHERE Not (Year08 = Year09 And Year08 = Year10 And Year08 = Year11 And Year08 = Year12)

Open in new window

0
 

Author Comment

by:mig1980
ID: 38837675
I will give this  a try and see if it works.
0
 

Author Comment

by:mig1980
ID: 38841158
Thank you very much. That worked well.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question