473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to create a query for comparing 2 fields from a table

Hello!!!!!!!!

In MS ACCESS i need to create a query that compares 2 fields from a single table and generate a report or redirect to a report which should consist of matched data among 2 fields and unmatched data seperately from field1 and field2.
Jan 30 '08 #1
7 3184
MindBender77
234 100+
Hello!!!!!!!!

In MS ACCESS i need to create a query that compares 2 fields from a single table and generate a report or redirect to a report which should consist of matched data among 2 fields and unmatched data seperately from field1 and field2.
It might be easier to create 2 separate queries. One for matched data and the second for unmatched data. Then create the report(s) based on those queries.

Hope this points you in the right directions,
JS
Jan 30 '08 #2
It might be easier to create 2 separate queries. One for matched data and the second for unmatched data. Then create the report(s) based on those queries.

Hope this points you in the right directions,
JS

Fine then what will be the query for matching and unmatching in access
Jan 30 '08 #3
MindBender77
234 100+
Hello!!!!!!!!

In MS ACCESS i need to create a query that compares 2 fields from a single table and generate a report or redirect to a report which should consist of matched data among 2 fields and unmatched data seperately from field1 and field2.
Try this for Matching:
Expand|Select|Wrap|Line Numbers
  1. SELECT Field1, Field2
  2. FROM YourTable
  3. WHERE (((Field1)=[Field2]))
  4. GROUP BY Field1, Field2;
  5.  
Then for Unmatching:
Expand|Select|Wrap|Line Numbers
  1. SELECT Field1, Field2
  2. FROM YourTable
  3. WHERE (((Field1)<>[Field2]))
  4. GROUP BY Field1, Field2;
  5.  
Hope this Helps,
JS
Jan 30 '08 #4
Try this for Matching:
Expand|Select|Wrap|Line Numbers
  1. SELECT Field1, Field2
  2. FROM YourTable
  3. WHERE (((Field1)=[Field2]))
  4. GROUP BY Field1, Field2;
  5.  
Then for Unmatching:
Expand|Select|Wrap|Line Numbers
  1. SELECT Field1, Field2
  2. FROM YourTable
  3. WHERE (((Field1)<>[Field2]))
  4. GROUP BY Field1, Field2;
  5.  
Hope this Helps,
JS



In Access where do we write queries like these.........It seems to be as SQL Query.If i am wrong plz do correct me and tell me where do i write this query in MS access
Jan 31 '08 #5
MindBender77
234 100+
In Access where do we write queries like these.........It seems to be as SQL Query.If i am wrong plz do correct me and tell me where do i write this query in MS access
You can write these sql queries in access by opening a query in SQL View from the query designer.

JS
Jan 31 '08 #6
You can write these sql queries in access by opening a query in SQL View from the query designer.

JS

One more doubt!!!!!!!!!!

Every item of Field1 should be compared to all attributes of Field2 and then produce the result...............(ie)comparing all items of Field 1 to Field2 and then producing the common items in bith the Fields..............i think this time have put up my right question.............plz do tell me how the query has to be written(codings)
Feb 1 '08 #7
You can write these sql queries in access by opening a query in SQL View from the query designer.

JS

One more doubt!!!!!!!!!!

Every item of Field1 should be compared to all attributes of Field2 and then produce the result...............(ie)comparing all items of Field 1 to Field2 and then producing the common items in both the Fields..............and even not matching ones..........i think this time have put up my right question.............plz do tell me how the query has to be written(codings)
Feb 1 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Apple | last post by:
1. I want to create an autonumber, my requirement is : 2005/0001 (Year/autonumber), which year & autonumber no. both can auto run. 2. I had create a query by making relation to a table & query,...
6
by: tizmagik | last post by:
I am having a lot of difficulty generating a CrossTab Query based report. I have looked online for several tutorials and whatnot but I have not been able to really find what I'm looking for, nor...
2
by: angie | last post by:
I need to figure out how to create a user interface to search a query, but here's the bad part...I need to account for criteria on at least 7 of the fields. Here's what I'm thinking I need to do:...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
3
by: tcveltma | last post by:
Hi Everyone, I know there's been a lot of questions regarding the same kind of issue but I haven't been able to find an answer to my specific problem. Basically I have two tables, one table...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
1
by: cdhaynes | last post by:
Hi, I am using unbound text boxes in the header of a form to allow the user to search on a number of fields. I am using VBA to build a query string based on these and it has been fine when comparing...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
12
by: tekctrl | last post by:
Environment; Win2K PC with 1Gb of RAM and plenty of HD space running Access 2002 Issue; Access presents a blank data entry form in the Forms view when the New Record icon is used. However, it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.