Dear friends, this question was answered before but i recieved error due to incomplete script so again asking this questionI have the following table has the passengers informations here is the complete fields:

what i want is to have some details from this table in to another view to looks like the below table where there is some time passengers traveling on the same reservation # i want them in new field(All of them in one field separated by , or |) and another field shows the number of passengers and i want to know the time difference between the purchase date and flight date also some time same passenger goes from example from first city to the second city with stay in middle city(transit city) ex. a-b-c so i want the B city to be in different field some time i could have two transit cities like (a-b-c-d) so i want b and in this field:i also need the first departure city and last arrival city to be instead of departure city column and arrival city column like below:[Pax ID]| Reservation| Surname| Pax in same Res#| Difference between flight date and purchase date| Transit city|100001 |10001 | Mike|Jason,amit |3 | 2 days | | 100002 |10001 | Jason|Mike,amit |3 | 2 days | | 100003 |10001 | Amit|Jason,Mike |3 | 2 days | |100004 | 10002 | jack| |1 | 11 days | AMM |

here Two passengers in the same booking number and one way ticket so the output should be Two rows one row showing the passenger is Jason Amit and the passenger traveling with him Jason Sam and the other row should be Jason Sam as main passenger and the travelling with him Jaosn Amit. 100002 | 10003 | Jason | Amit | 10/10/2013 | RJ500 | JED | BOM |10/10/2013 15:10 | 08/10/2013 100008 | 10003 | Jason | Sam | 10/10/2013 | RJ500 | JED | BOM |10/10/2013 15:10 | 08/10/2013

Here i have two passengers is going from Del - AMM then AMM - CAI means two flights and the transit city is AMM and the departure city is DEL - and the arrival city is CAI in the previous query it was showing the transit city is AMM and the departure city is AMM too while it was DEL means it took the departure of the second row instead of the first row. and flight numbers should be RJ200, RJ300 while currently( RJ200,RJ200,RJ300, RJ300) means duplicate flight number. also some time two passengers are having in this case the output will have Two rows instead of 4 rows one row for each passenger also in pr

this is round trip booking with Two flights number RJ800, RJ900 there will be no transit city for each record as its direct CDG - ORY and the return is ORY - CDG. there should be two records here one record for each flight. 100006 | 10006 | Akbar | Ahmed | 24/11/2013 | RJ800 | CDG | ORY |20/11/2013 10:00 | 10/11/2013100006 | 10006 | Akbar | Ahmed | 28/11/2013 | RJ900 | ORY | CDG |20/11/2013 10:00 | 10/11/2013

here the flight is Del- AMM then AMM - CAI and then CAI - CDG the transit city will be two cities which is here AMM and CAI so it the transit column should have both cities seprated with comma and one row to include the departure city which is Del and arrival city which is here CDG also the the flight numbers which is RJ200, RJ300, RJ400 it should have Two rows in this scenario one for each passenger as both are traveling on same Booking number. 100009 | 10010 | karim | Saeed | 12/12/2013 | RJ200 | Del | AMM |11/11/2013 20:00 | 1/11/2013 100009 | 10010 | Karim | Saeed | 13/12/2013 | RJ300 | AMM | CAI |11/11/2013 01:00 | 1/11/2013100010 | 10010 | Karim | Saeed | 13/12/2013 | RJ400 | CAI | CDG |11/11/2013 20:00 | 1/11/2013

please let me know if you have any doubt in my query. thank you and B. Regards

Hi All, I need to get new report that has the following data : 1- Passengers traveling together in the same Reservation number the column is(Reservation) so new column should contain all the passengers traveling with the main passenger and separated by comma. and each passenger should have his own record and again adding in the new column ( passengers traveling with) the other passengers in the same Reservation. for example:

2- Number of passengers in the same reservation Number will be stored in column called ( Number of passengers)

3- if the flight is via connection point(transit city) i want to put the connection city in new column which is called( transit city) and in case there is more than one transit city then both cities should be mentioned separated by comma.for example passenger is traveling from A TO D with transit of one hour transit in B and some times another 3 hours in C so the transit cities should include B,C. and the departure city should be A AND Arrival city should D. so one row will contain this information / passenger.

3- Different between purchase date and flight date to be stored in new column called ( different between purchase and flight date)

4- arrival date is new requirement which should include the departure date of the second flight for example reservation having passenger traveling from A TO B and then B TO C the departure of the first flight is on 22dec2013 and the departure of the second flight is on 23dec2013 so the arrival will be the last flight departure date.