group data based on two different fields within Access (1 Viewer)

Thomp001

Registered User.
Local time
Today, 14:33
Joined
Mar 14, 2003
Messages
12
How would you group data based on two different fields within Access. Looking for some type of query or calculated field that I could then use to see the two-paired lines together.

Attachment shows data better than preview

Here is what I am trying to do

Column A Column B Column C Column D

Number Line Other Data Other Data 2
123456 10 Yes No
123456 9 No Yes
123456 10 Yes No
333388 10 Yes Yes
333388 2 Yes No
333388 2 No No


My goal is to identify any number in column A that is first a match to the same number in Column A and then is a match to the same line number in Column B

Example if done correctly my results would show the following:

Column A Column B Column C Column D

Number Line Other Data Other Data 2
123456 10 Yes No
123456 10 Yes No
333388 2 Yes No
333388 2 No No
 

Attachments

  • How would group data based on two different fields within Access.docx
    12.2 KB · Views: 87

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:33
Joined
Feb 28, 2001
Messages
27,142
The syntax of GROUP BY usually implies an aggregate function like SUM or COUNT, but ORDER BY does not.

Code:
SELECT ColA, ColB, ColC, ColD FROM MyData ORDER BY ColA, ColB ;
 

plog

Banishment Pending
Local time
Today, 08:33
Joined
May 11, 2011
Messages
11,638
Can you provide better sample data? I don't know what data you are starting with and I can't parse field names with what you've provided. Provide 2 sets of data:

A. Starting sample data from all relevant tables. Include table and field names and enough sample data to cover all cases.

B. Expected results of A. Show what data you expect to end up with when you run the query on the data in A.

For posting use this format:

TableNameHere
Column1NAme, Column2Name, Column3NAme, ...
Steve, 1/1/2019, 29
Jim, 3/1/2019, 44
Sally, 2/1/2019, 13

Only provide one set of column names and delimit your data with commas.
 

Users who are viewing this thread

Top Bottom