How to perform the query

Results 1 to 2 of 2

Thread: How to perform the query

  1. #1
    Join Date
    Dec 1969

    Default How to perform the query

    I am doing an online booking system for courts.I have fields such as timein and timeout. If the user wants to book from 9-11am, and it is already book from 10-11am, how do I detect that?

  2. #2
    J. Paul Schmidt Guest

    Default RE: How to perform the query

    This might not be the exact SQL WHERE clause but at least you can get the drift of the concept:<BR><BR>"WHERE ((MyTable.UserBeginTime Between #" & ThisUserBeginTimeVariable & "# And #" & ThisUserEndTimeVariable & "#)) OR ((MyTable.UserEndTime Between #" & ThisUserBeginTimeVariable & "# And #" & ThisUserEndTimeVariable & "#));"<BR><BR>The semicolon at the end assumes that the WHERE clause is the final part of the SQL.<BR><BR>Also the above does not show the date in the WHERE clause which of course would also be needed to limit records to the proper date.<BR><BR>And if there were one or more records, then there is a problem and the user could be shown the records as they all conflict somehow with the time he or she has chosen.<BR><BR>Best regards,<BR>-Paul<BR><BR>J. Paul Schmidt, MBA<BR>Databases on the Web<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts