2 Replies Latest reply on Oct 11, 2011 12:22 AM by NikolajThestrup

    Start/Stop date itinerary

    NikolajThestrup

      Title

      Start/Stop date itinerary

      Post

      Okay here we go:

      cant figure this out, I need to build a travel itineray from a booking list based on start/end dates

      each related record contains a start date and end date.

      iam able to list every related record using "list" as this:


      Monday 11/07/2011 19.30
      Monday 11/07/2011 20.55
      Flight

      Monday 11/07/2011 21.55
      Tuesday 12/07/2011 15.50
      Flight


      Tuesday 12/07/2011
      Saturday 16/07/2011
      Hotel


      Saturday 16/07/2011
      Sunday 24/07/2011
      Hotel


      Sunday 24/07/2011
      Monday 25/07/2011
      Hotel


      Monday 25/07/2011 23.05
      Tuesday 26/07/2011 05.50
      Flight

      Tuesday 26/07/2011 06.30
      Tuesday 26/07/2011 08.00
      Flight


      It should go like this, grouped by dates

      Monday 11/07/2011
      19.30 Flight dep.
      20.55 Flight arr.
      21.55 Flight dep.

      Tuesday 12/07/2011
      15.50 Flight arr.
      16.00 Hotel arr.

      Sunday 24/07/2011
      12.00 Hotel dep.
      16.00 Hotel arr.

      Monday 25/07/2011
      12.00 Hotel dep
      23.05 Flight dep

      Tuesday 26/07/2011
      05.50 Flight arr.
      06.30 Flight dep.
      08.00 Flight arr.

      ANY HELP?

      cheers

        • 1. Re: Start/Stop date itinerary
          philmodjunk

          Looks like you need separate records instead of one record with start and stop time stamp.

          • 2. Re: Start/Stop date itinerary
            NikolajThestrup

            Thanks for the quick reply... iam not able to "split" the records, all data comes from sql db... what i have done so fare is build a view in sql...

             

            2011-07-11 19:30:00 Flight
            2011-07-11 21:55:00 Flight
            2011-07-11 20:55:00 Flight
            2011-07-12 16:00:00 Transfer
            2011-07-12 16:20:00 Hotel
            2011-07-12 15:40:00 Flight
            2011-07-16 Hotel
            2011-07-16 11:00:00 Transfer
            2011-07-16 Hotel
            2011-07-24 Hotel
            2011-07-24 Hotel
            2011-07-24 12:00:00 Transfer
            2011-07-25 23:05:00 Flight
            2011-07-25 Hotel
            2011-07-26 06:30:00 Flight
            2011-07-26 05:50:00 Flight
            2011-07-26 08:00:00 Flight
            2011-07-26 14:00:00 Transfer

            there is a small sort problem... but how do i loop the data set to group it by date and dump in a new table:

            2011-07-11
            19:30:00 Flight 
            21:55:00 Flight 
            20:55:00 Flight 

            2011-07-12
            15:40:00 Flight
            16:00:00 Transfer 

            .....

            2011-07-25
            20:00:00 Hotel 
            23:05:00 Flight 

            2011-07-26
            06:30:00 Flight 
            05:50:00 Flight 
            08:00:00 Flight 
            14:00:00 Transfer