New Federal Guidelines mandate that we allow each of our students to identify themselves as being a member of at least 1 Race, and as many as 5.
We're using a commercial database where the vendor has seen fit to make 1 record per student in the STUDENT table, and multiple records for each student in the RACE table.
My challange is that I have to produce a flat file with one record per student and include five race fields. The first field will have to be something other than the NA value (00), but the second thru fifth fields might be either 00 or one of the five possiblities. Obviously I cannot duplicate a choice.
So I'm trying to figure out how to identify the second thru fifth choices a student might have made. The RACE table has no provision for this, every record is just the StudentID and a Race Code (01, 02, 03, 04, 05).
I hoped to just pull all Race Codes of 01 and put them in the Race1 field of my output file, but the requirement now is that I cannot have 00 in the Race1 field, and then a value in the second race field. So I can't submit something like 00 00 03 00 05. It would have to be 03 05 00 00 00
So I somehow have to pull a code for every student into Race1, then keep track of what I've already pulled, go back and see if the student has another selection, put that in Race2, mark it as used, and go back and see if they have another selection.....
I think I can do this with some fairly ugly combination of temp table and CASE statements, but I was hoping for something more elegant.
TIA Mike
We're using a commercial database where the vendor has seen fit to make 1 record per student in the STUDENT table, and multiple records for each student in the RACE table.
My challange is that I have to produce a flat file with one record per student and include five race fields. The first field will have to be something other than the NA value (00), but the second thru fifth fields might be either 00 or one of the five possiblities. Obviously I cannot duplicate a choice.
So I'm trying to figure out how to identify the second thru fifth choices a student might have made. The RACE table has no provision for this, every record is just the StudentID and a Race Code (01, 02, 03, 04, 05).
I hoped to just pull all Race Codes of 01 and put them in the Race1 field of my output file, but the requirement now is that I cannot have 00 in the Race1 field, and then a value in the second race field. So I can't submit something like 00 00 03 00 05. It would have to be 03 05 00 00 00
So I somehow have to pull a code for every student into Race1, then keep track of what I've already pulled, go back and see if the student has another selection, put that in Race2, mark it as used, and go back and see if they have another selection.....
I think I can do this with some fairly ugly combination of temp table and CASE statements, but I was hoping for something more elegant.
TIA Mike