Re: MySQL and dates puzzle

2005-10-28 Thread SGreen
Mike, you did a wonderful job at analysis (identifying the 6 cases) but I think a series of visual clues would have made a simpler query more obvious. Here's how I understand the issue (I am a more visual thinker) Start with the case of needing to see if a new record (NR) overlaps with an

Re: MySQL and dates puzzle

2005-10-28 Thread Michael McFadden
Sean, you definately got me :) Your solution is simpler and much more elegant! Had the visual aids here on paper, but I'm not as good with the ascii art as you. I definately learned something! Thanks! -Mike --- [EMAIL PROTECTED] wrote: Mike, you did a wonderful job at analysis (identifying

MySQL and dates puzzle

2005-10-27 Thread C.F. Scheidecker Antunes
Hello all, I have a TA table to record TA UNAVAILABLE times. This table is quite simple. It has a TAID number, a start date and an end date. tbl_schedule { TAID integer, starts datetime, ends datetime } A valid entry would be a TA whose id is 1 and between 17:00 and 18:00 he is busy. So:

Re: MySQL and dates puzzle

2005-10-27 Thread Michael McFadden
Hi C.F. I'm new to the list, so please excuse me if I'm answering out-of-turn from the pro's here. I think the answer is to also check if the BusyTime_start is between start and end of the attempted scheduled. ie: WHERE (TAID = 1) AND (('2005-10-27 17:30' BETWEEN starts AND ends) OR

Re: {Spam?} MySQL and dates puzzle

2005-10-27 Thread ddevaudreuil
@lists.mysql.com cc Subject {Spam?} MySQL and dates puzzle Hello all, I have a TA table to record TA UNAVAILABLE times. This table is quite simple. It has a TAID number, a start date and an end date. tbl_schedule { TAID integer, starts datetime, ends datetime } A valid entry would be a TA