?
Solved

Access - find exact match on text fields

Posted on 2011-10-20
9
Medium Priority
?
680 Views
Last Modified: 2012-05-12
Hi,

What is the most efficient manner to find or query where there is not an exact match in a text field in Access. For example, a 2010 file, the field is "the rainbow was bright" and 2011, the field says "the rainbow was bright and fit the entire sky."

I want to be able to flag that these two fields are not the same.

Thank you
0
Comment
Question by:tahirih
  • 4
  • 3
  • 2
9 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 1000 total points
ID: 37002941
Not sure I understand without a visual example, ...

But try something like this as a query:

SELECT Field1, Field2, IIF(Field1=Field2,"","Not the same") AS Result
FROM YourTable

JeffCoachman
0
 
LVL 44

Expert Comment

by:GRayL
ID: 37003005
I hate negative questions ;-)

SELECT Fld1, Fld2, Fld1=Fld2 AS Same FROM myTable
0
 
LVL 44

Assisted Solution

by:GRayL
GRayL earned 1000 total points
ID: 37003019
Better yet:

SELECT Fld1, Fld2, CBool(Fld1=Fld2) AS Same FROM myTable;
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37003181

To be fair, Ray brings up a good point.
I know that every situation is different, ...but generally it is clearer to most people to see when something "Is", rather than when it "Is Not"

So I have no issue with you accepting his post...


Jeff
0
 
LVL 44

Expert Comment

by:GRayL
ID: 37003499
Thanks Jeff:  Especially when the "Is Not" is "Is Not" ;-)
0
 

Author Comment

by:tahirih
ID: 37008095
Thank you everyone - please give me a bit to try everything - and I will finsih this question.
0
 

Author Closing Comment

by:tahirih
ID: 37008652
Thank you both
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37010843
;-)
0
 
LVL 44

Expert Comment

by:GRayL
ID: 37012636
Thanks, glad to help
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

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