I've been trying to figure out an "easy" way to create a mailing list of my students with the usual lastname, firstname, address, city, state, etc. This all works fine - except that I'm getting multiple records for the same family when they have more than
one children in our database. So, ideally, I would like to be able to group by the family name (which is grouped in a seperate Family table then linked to the student table by familyid), then in the second field list each child of that family separated by
a comma. I just thought I'd check to see if anyone out there has already done it and is willing share. I have to believe this is a common scenario.
Your information indicates you need to redesign your structure of tables and use join query, and you aslo mentioned how to redesign the tables. Therefore, the key point how to use join query to retrieve the records, please check this reference about join
query:
lpieczynski
Member
15 Points
45 Posts
Procedure to group by Family (Last) Name then concantenate all first names together in a second f...
Oct 20, 2011 08:39 PM|LINK
I've been trying to figure out an "easy" way to create a mailing list of my students with the usual lastname, firstname, address, city, state, etc. This all works fine - except that I'm getting multiple records for the same family when they have more than one children in our database. So, ideally, I would like to be able to group by the family name (which is grouped in a seperate Family table then linked to the student table by familyid), then in the second field list each child of that family separated by a comma. I just thought I'd check to see if anyone out there has already done it and is willing share. I have to believe this is a common scenario.
Thanks in advance! - Lana
Mamba Dai - ...
All-Star
23531 Points
2683 Posts
Microsoft
Re: Procedure to group by Family (Last) Name then concantenate all first names together in a seco...
Oct 25, 2011 08:23 AM|LINK
Hi,
Your information indicates you need to redesign your structure of tables and use join query, and you aslo mentioned how to redesign the tables. Therefore, the key point how to use join query to retrieve the records, please check this reference about join query:
http://msdn.microsoft.com/en-us/library/ms191517.aspx
By the way, if you can post your problem to this:
http://forums.asp.net/1226.aspx/1?SQL+Server+SQL+Server+Express+and+SQL+Compact+Edition
You will recieve more professional and exact idea for your issue.
Feedback to us
Develop and promote your apps in Windows Store