Solved

Access 2007 query

Posted on 2013-01-30
5
246 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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

679 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