Hello,
I have browsed through the board but cant find anything similar to what I require.
I am building a booking system and I have multiple views, day/week/month for the booking calendar. I have been able to get the day view working, but now am stuck. I cant find a way to retrieve the bookings for a given week from my database.
I tried the following query:
------------------------------------------------------------------
select * from bookings where '2008-12-07 00:00:00' AND '2008-12-14 00:00:00' BETWEEN bookings.starting_date AND bookings.ending_date;
------------------------------------------------------------------
My bookings table has the following fields
------------------------------------
booking_id
user_id
subject
location
starting_date
ending_date
description
date
-----------------------------------
Thanks
Booking system- bookings per week
Moderator: General Moderators
- andym01480
- Forum Contributor
- Posts: 390
- Joined: Wed Apr 19, 2006 5:01 pm
Re: Booking system- bookings per week
Something like? SELECT * FROM bookings WHERE bookings.starting_date BETWEEN '2008-12-07 00:00:00' AND '2008-12-14 00:00:00' AND bookings.ending_date BETWEEN '2008-12-07 00:00:00' AND '2008-12-14 00:00:00' ;
Re: Booking system- bookings per week
The query still returns the same result as mine. 