Solved Query to combine Separate lines within a table (1 Viewer)

Number11

Member
Local time
Today, 03:14
Joined
Jan 29, 2020
Messages
607
Hello,
I need to find a way of having a query show the data within a table on separate Lines (records) for the same Customers on one line

The fields I would need are

Customer_Account (contained in both records)

MAC_Serial_ElectrciityTV (on separate Record lines)

MAC_Serial_ElectrciityPC (on separate Record lines)

looking for results to show on one line like this

Customer_Account MAC_Serial_ElectrciityTV MAC_Serial_ElectrciityPC
 

Number11

Member
Local time
Today, 03:14
Joined
Jan 29, 2020
Messages
607
build separate queries and pulled together using Group By
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 21:14
Joined
Feb 28, 2001
Messages
27,172
I see you answered your own question - using GROUP BY (probably on Customer_Account). That is reasonable.

However, I would like to offer an observation (NOT INTENDED AS A CRITICISM). The structure of these two tables that you mention makes me wonder WHY that information is kept in separate tables but still is dependent on the same key. Normally, that would be considered a violation of normalization. Just observing...
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:14
Joined
Feb 19, 2002
Messages
43,262
Did you try using a crosstab query? That is the typical way to pivot the many-side data so it appears in one row.
 

Users who are viewing this thread

Top Bottom