Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MS Access (http://www.go4expert.com/forums/ms-access-forum/)
-   -   Need urgent help to Update query on a table with student and his siblings (http://www.go4expert.com/forums/urgent-help-update-query-table-student-t10612/)

sourabh20 14May2008 21:01

Need urgent help to Update query on a table with student and his siblings
 
Hi

I have a table with Columns: Student_ID,Student_Name,Sibling1_name,Sibling2_nam e,Sibling3_name.

Student_ID(PK), Student_Name, Sibling1_Name, Sibling2_Name, Sibling3_Name
ROW1: 1, A, B, C, D
ROW2: 2, E, F, G
ROW3: 3, H, I
ROW4: 4, J







For every Student_ID I have 1 unique student name and his/her siblings.

I want to create a query:

1. To copy all these siblings to Student_Name column.


S.No.(Autonumber), Student_ID(PK) Sibling1_Name Sibling2_Name Sibling3_Name
ROW1: 1, 1, A, B, C, D
ROW2: 1, 2, E, F, G
ROW3: 3, 3, H, I
ROW4: 4, 4, J
ROW5: 5, 1, B
ROW6: 6, 2, F
ROW7: 7, 3, I
ROW8: 8, 1, C
ROW9: 9, 2,G
ROW10:10, 1, D

then

2. To copy the names of all the siblings(including the original student) realted to the new student(Ist column) in front of the new student.

Like this:


S.No., Student_ID(PK) Student_Name Sibling1_Name Sibling2_Name Sibling3_Name
ROW1: 1, 1, A, B, C, D
ROW2: 2, 2, E, F, G
ROW3: 3, 3, H, I
ROW4: 4, 4, J
ROW5: 5, 1, B ,A, C, D
ROW6: 6, 2, F, E, G
ROW7: 7, 3, I, H
ROW8: 8, 1, C, A , B, D
ROW9: 9, 2, G, E, F
ROW10: 10, 1, D, A, B, C



Please guide me for this query or procedure.



Thanks,

S.B.

:)


All times are GMT +5.5. The time now is 20:31.