upper query to get the info... lesson struct stuff: temp_start_time = 103000 temp_end_time = 113000 temp_assinged_to = "unassigned" assigned_to_id = 1 formatted_start_time = 10:30 formatted_end_time = 11:30 actual_start_time = 10:30 am actual_end_time = 11:30 am temp_column_count = 5 (default = 1) temp_time_difference = 120 (default = 0) temp_sub_array = array new time_id = 220 prior_flag = 0 (default = 0) after_flag = 0 (default = 0) color_value = "yellow" hex_value = "FF00FF" temp_time_difference = 60 seconds ////////////////////////////////////////////////////////////////// next loop - over the union payee names an id's. qry get all main qry get all prior qry get all past qry get all full spans qry get all leading qry get reoccurring qry get reoccurring prior qry get reoccurring past qry get reoccurring full spans qry get reoccurring leading *** new ones need to go here... what are they? line 825 (ish) qry get extra main qry get extra prior qry get extra past qry get extra full spans qry get extra leading struct per person: payee_id = 2 name = "Brandon Moore" main_count = 1 prior_count = 0 past_time_count = 0 reoccurring_count = 0 reoccurring_prior_count = 0 reoccurring_past_time_count = 0 extra_main_count = 1 extra_prior_count = 0 extra_past_time_count = 0 column_sum = 0 data_array = array new - array of structs column_count = 1 use = 1 link_start_time = 9:00 am formatted_start_time 9:00 formatted_end_time 10:00 time_id = 55 hex_value "FF0000" time_difference = 60 overflow_array = array new use = 1 front_spacer_length = 0 column_count = 1 end_spacer_length = 0 overflow_difference = 0 link_start_time = 9:00 am formatted_start_time = 9:00 formatted_end_time = 10:00 time_id = 65 hex_value = "0000FF" overflow_difference = timeSlotStatus = "open" timeSlotClosedTill = "open" /////////////////////////////////////////////////////////////////// next loop - sub loop - over the number of time slots. if timeSlotClosedTill is q reset timeSlotStatus and timeSlotClosedTill vars to open temp_time = 90000 for 9:00:00 am temp_next_time = 93000 for 9:30:00 am qry get matching main qry get matching reoccurring qry get matching extra main if q is 1 if qry main full span > 0 normal mini struct append to the data array add to the column sum flip timeSlotStatus to closed flip the timeSlotClosedTill to the full count + 1 (full time span) if more than 1 main full span loop over main full spans - skip record 1 (already recorded) mini overflow struct append to the overflow array end if more than 1 full span ///////////////////////////// if timeSlotStatus is open and qry get reoccurring full is > 0 normal mini struct append to the data array add to the column sum flip timeSlotStatus to closed flip the timeSlotClosedTill to the full count + 1 (full time span) if more than 1 reoccurring full span loop over reoccurring full spans - skip record 1 (already recorded) mini overflow struct append to the overflow array eles if timeSlotStatus is closed and qry get reoccurring full is > 0 loop over the qry reoccurring full spans mini overflow struct append to the overflow array end if for qry reoccurring full ////////////////////////////////// if timeSlotStatus is open and qry get main lead in's > 0 normal mini struct append to the data array add to the column sum flip timeSlotStatus to closed flip the timeSlotClosedTill to the lead in count + 1 (lead in time span) if more than 1 main lead in loop over main lead in's - skip record 1 (already recorded) mini overflow struct append to the overflow array else if timeSlotStatus is closed and qry get main lead in's > 0 loop over the qry get main lead in's mini overflow struct append to the overflow array end if for qry get main lead in's ////////////////////////////////////// if timeSlotStatus is open and qry get reoccurring lead in's > 0 normal mini struct append to the data array add to the column sum flip timeSlotStatus to closed flip the timeSlotClosedTill to the lead in count + 1 (lead in time span) if more than 1 reoccurring lead in loop over reoccurring lead in's - skip record 1 (already recorded) mini overflow struct append to the overflow array else if timeSlotStatus is closed and qry get reoccurring lead in's > 0 loop over the qry get reoccurring lead in's mini overflow struct append to the overflow array end if for qry get reoccurring lead in's end if q is 1 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if timeSlotStatus is open if no qry get matching main is 0 and qry get matching reoccurring is 0 normal mini struct (not all fields and/or keys - somewhat smaller) append to the data array (open spot) end if ///////////////////////////////////// if timeSlotStatus is open and qry get matching main > 0 normal mini struct append to the data array add to the column sum flip timeSlotStatus to closed flip the timeSlotClosedTill to the normal count + 1 (normal time span) if more than 1 main time span loop over the matching mains - skip record 1 (already recorded) mini overflow struct append to the overflow array else if timeSlotStatus is closed and qry get matching main > 0 loop over the qry get matching mains mini overflow struct append to the overflow array end if for qry get matching mains ///////////////////////////////////// if timeSlotStatus is open and qry get matching reoccurring > 0 normal mini struct append to the data array add to the column sum flip timeSlotStatus to closed flip the timeSlotClosedTill to the normal count + 1 (normal time span) if more than 1 reoccurring time span loop over the matching reoccurring - skip record 1 (already recorded) mini overflow struct append to the overflow array else if timeSlotStatus is closed and qry get matching reoccurring > 0 loop over the qry get matching reoccurring mini overflow struct append to the overflow array end if for qry get matching reoccurring /////////////////////////////////////// else (assumes closed - general catch all stuff) if qry get matching mains > 0 loop over matching mains mini overflow struct append to the overflow array if qry get matching reoccurring > 0 loop over matching reoccurring mini overflow struct append to the overflow array end if (main open or closed status) end inner loop (per time slot) add to the master array end outer loop (per person)