Solved

Access 2007 query

Posted on 2013-01-30
5
209 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
  • 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now