table booking
----------------------------------------------------------------------------------------------------------------------------
| ID | HPLC | StartDate | Testing | EndDate |
----------------------------------------------------------------------------------------------------------------------------
| 1 | HPLC1 | 08/06/2013 12:00:00 | Mirta RS | 08/06/2013 18:00:00 |
----------------------------------------------------------------------------------------------------------------------------
| 2 | HPLC2 | 09/06/2013 10:00:00 | Olan ASS | 09/06/2013 15:00:00 |
----------------------------------------------------------------------------------------------------------------------------
| 3 | HPLC1 | 08/06/2013 10:00:00 | Mirta ASS | 08/06/2013 12:00:00 |
----------------------------------------------------------------------------------------------------------------------------
| 4 | HPLC3 | 08/06/2013 09:00:00 | RISP DISS | 08/06/2013 16:00:00 |
----------------------------------------------------------------------------------------------------------------------------
table hplc
-----------------------------------------
| ID | HPLC |
-----------------------------------------
| 1 | HPLC1 |
-----------------------------------------
| 2 | HPLC2 |
-----------------------------------------
| 3 | HPLC3 |
-----------------------------------------
| 4 | HPLC4 |
-----------------------------------------
| 5 | HPLC5 |
-----------------------------------------
table hplcslot.... I only pasted a piece of it just to have an idea as it has 480 rows.
"HPLC2",1," 06:00:00"," 06:15:00"
"HPLC2",2," 06:15:00"," 06:30:00"
"HPLC2",3," 06:30:00"," 06:45:00"
"HPLC2",4," 06:45:00"," 07:00:00"
"HPLC2",5," 07:00:00"," 07:15:00"
"HPLC2",6," 07:15:00"," 07:30:00"
"HPLC2",7," 07:30:00"," 07:45:00"
"HPLC2",8," 07:45:00"," 08:00:00"
"HPLC2",9," 08:00:00"," 08:15:00"
"HPLC2",10," 08:15:00"," 08:30:00"
"HPLC2",11," 08:30:00"," 08:45:00"
"HPLC2",12," 08:45:00"," 09:00:00"
"HPLC2",13," 09:00:00"," 09:15:00"
"HPLC2",14," 09:15:00"," 09:30:00"
"HPLC2",15," 09:30:00"," 09:45:00"
"HPLC2",16," 09:45:00"," 10:00:00"
"HPLC2",17," 10:00:00"," 10:15:00"
"HPLC2",18," 10:15:00"," 10:30:00"
"HPLC2",19," 10:30:00"," 10:45:00"
"HPLC2",20," 10:45:00"," 11:00:00"
"HPLC2",21," 11:00:00"," 11:15:00"
-------------------------------------------------
basically what I want to do is run a query which will list all the slots available [from 6 am to 6 am the next day with 15min slots] (hplcslot) (ie. which are not booked in the table booking) for all the hplc's listed in the table HPLC.
this would be similar to have multiple rooms with multiple bookings per day, to list the available rooms.. not the rooms booked.
I tried to above code but it doesn't seem that I have much success.