Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get record from time selected

Status
Not open for further replies.

lenelene

Programmer
Dec 10, 2002
57
MY
hi all,

my form consists of selecting "from time" and "to time" to select room booking.

my database also consists of two field which is are also from time and to time.

the problem is i want to display records that the period time that the user has selected is already exist in the database,

for example, the user wants to book room from 9 am to 10 am, so the from_time will be 9 am and the to_date will be 10 am.

if the records in the database, where by the room has been booked from 8 am to 10 am, which from_time is 8 am and to_time is 10 am,it will display record for this to indicate that the user that the room has been booked for that time period she has selected.

how to write the sql coding?

select * from roomHotel
where from_time (???)
and to_time (???)
 
How about this?
Code:
SELECT * FROM roomHotel
WHERE
   #FORM.from_time# BETWEEN from_time AND to_time
   OR #FORM.to_time# BETWEEN from_time AND to_time
-pcorreia
Hope this was a Helpful post!
 
thankyou but i try another method to retrieve,,,thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top