?
Solved

Access 2007 query

Posted on 2013-01-30
5
Medium Priority
?
265 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 93

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 93

Accepted Solution

by:
Patrick Matthews earned 1200 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

850 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