Hello,
I played with this data for an entire day and still couldn't figure out how to get it the way I need it. Here is a sample of my data:
Site CustID Name PhoneNumber Code
TX01 101 Jane Smith 222-222-222 A1C357
TX01 103 John Key NULL A1C258
TX01 103 John Key NULL B999-tx
TX01 104 Jane Thomas NULL A1C987
Tx01 104 JAne Thomas NULL C78d-tx
-The CustID is unique for every customer
-There are 3 types of Codes
1. The ones that start with "A1C"
2. The ones that end with "-tx"
3. The ones that have a "+" in the code
-The same customer can have a record for one, two , or three of these codes (ex. John Key & Jane Thomas in sampe data above have A1C and -tx codes)
What I need to do with this data is somehow group it (I have also tried a CASE and UNION statements) so that the data displays only ONE record per person and lists all of their codes in that record, like this:
Site CustID Name PhoneNumber Code-A1C Code-tx Code+
TX01 101 Jane Smith 222-222-222 A1C357 NULL NULL
TX01 103 John Key NULL A1C258 B999-tx NULL
TX01 104 Jane Thomas NULL A1C987 C78d-tx NULL
Any ideas on how to accomplish this?? I REALLY need to figure something out and I ran out of ideas.
Thank you!
I played with this data for an entire day and still couldn't figure out how to get it the way I need it. Here is a sample of my data:
Site CustID Name PhoneNumber Code
TX01 101 Jane Smith 222-222-222 A1C357
TX01 103 John Key NULL A1C258
TX01 103 John Key NULL B999-tx
TX01 104 Jane Thomas NULL A1C987
Tx01 104 JAne Thomas NULL C78d-tx
-The CustID is unique for every customer
-There are 3 types of Codes
1. The ones that start with "A1C"
2. The ones that end with "-tx"
3. The ones that have a "+" in the code
-The same customer can have a record for one, two , or three of these codes (ex. John Key & Jane Thomas in sampe data above have A1C and -tx codes)
What I need to do with this data is somehow group it (I have also tried a CASE and UNION statements) so that the data displays only ONE record per person and lists all of their codes in that record, like this:
Site CustID Name PhoneNumber Code-A1C Code-tx Code+
TX01 101 Jane Smith 222-222-222 A1C357 NULL NULL
TX01 103 John Key NULL A1C258 B999-tx NULL
TX01 104 Jane Thomas NULL A1C987 C78d-tx NULL
Any ideas on how to accomplish this?? I REALLY need to figure something out and I ran out of ideas.
Thank you!