Advertisement

08.03.2006 at 07:48AM PDT, ID: 21942098
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

Check for dates and times within a range

Asked by jkna_gunn in MySQL Server

Tags: , ,

I have a booking table with the following fields

from_date from_time to_date to_time

I would like to check if a given (from date/time and to date/time) will clash with any existing entries i have in the database. Though there is a time margin to be applied around those dates, in my example i have added 50 minutes to the from time and 80 mintues for the to times.  This is just a safety margin between bookings but important to incorporate.

for example;

2006-08-03   09:00:00     2006-08-05    23:00

in the above example, a user booking could not book on 2006-08-03 at 8:30 or 9:30 and he could also not book at 2006-08-05 at 00:10 or at 22:40.

I also need to return from this query (or in seperate if it must be) the next time slots that are available for each date. e.g. basically suggesting to the user what the closest next time is pre or post any existing times.

I have tried to do this but came across a problem with the times when they overlapped e.g. comparing 23:00 and 01:00 it failed in my BETWEEN clause, so there must be another better way of doing this.

just to recap, i need the query to see if there is a booking space for the gives dates and times, it must allow for a time margin between from and to times and it also must return next suitable timeslots if the query was unsuccessful. for this i basically wrote the query to return no rows if it was successfull.

any more questions please leave a comment,
thanks in advance.

Start Free Trial
 
Loading Advertisement...
 
[+][-]08.03.2006 at 08:00AM PDT, ID: 17242248

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2006 at 08:05AM PDT, ID: 17242303

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2006 at 08:12AM PDT, ID: 17242385

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2006 at 08:18AM PDT, ID: 17242443

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.31.2006 at 03:48AM PDT, ID: 17427831

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.04.2006 at 07:53AM PDT, ID: 17450009

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MySQL Server
Tags: check, range, to_time
Sign Up Now!
Solution Provided By: ee_ai_construct
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-42