Answered by:
Reg : Query

Question
-
User830885794 posted
I am using select statement and using join with some tables my query output is like belowID Code EmailAA24 Au Test1@test.comAA24 Au Test2@test.comAA24 Au Test3@test.comMS61 Ag S1@gg.comMS61 Ag S2@gg.comMS61 Ag S3@gg.comMS61 Ag S4@gg.comIf u look, only the Email column varies. I want my output like thisID Code EmailAA24 Au Test1@test.com; Test2@test.com; Test3@test.comMS61 Ag S1@gg.com; S2@gg.com; S3@gg.com; S4@gg.comHow to get output like above. do i need to use a function for printing the email id or without function can i do ?any ideasI am using select statement and using join with some tables my query output is like below
ID Code Email
AA24 Au Test1@test.com
AA24 Au Test2@test.com
AA24 Au Test3@test.com
MS61 Ag S1@gg.com
MS61 Ag S2@gg.com
MS61 Ag S3@gg.com
MS61 Ag S4@gg.com
If u look, only the Email column varies. I want my output like this
ID Code Email
AA24 Au Test1@test.com; Test2@test.com; Test3@test.com
MS61 Ag S1@gg.com; S2@gg.com; S3@gg.com; S4@gg.com
How to get output like above. do i need to use a function for printing the email id or without function can i do ?
any ideas
Tuesday, August 3, 2010 5:23 AM
Answers
-
User-1199946673 posted
Pick one solution from here
http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/
This quesion is being asked in the Access Databases and AccessDataSource Forum! Your solution won't work in Access/Jet!
How to get output like above. do i need to use a function for printing the email id or without function can i do ?This is not possible in Access (Jet) SQL. You need to retrieve the records like you have them using a datareader, and then loop through the records in code to get the desired output
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, August 3, 2010 12:23 PM
All replies
-
User-1952482173 posted
Pick one solution from here
http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/
Tuesday, August 3, 2010 10:12 AM -
User-1199946673 posted
Pick one solution from here
http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/
This quesion is being asked in the Access Databases and AccessDataSource Forum! Your solution won't work in Access/Jet!
How to get output like above. do i need to use a function for printing the email id or without function can i do ?This is not possible in Access (Jet) SQL. You need to retrieve the records like you have them using a datareader, and then loop through the records in code to get the desired output
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, August 3, 2010 12:23 PM