By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

prohibit double booking in room hire database

P: n/a
Hi

I have a database which logs the usage of rooms. Some booking are entered
well in advance, and some have stays of more than six months.

I would like to ensure that rooms which have been booked cannot be booked
again, i.e. cannot be booked in that date range

Any help will be much appreciated

Grant
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
rkc

"Grant" <ja*********@hotmail.com> wrote in message
news:c0**********@dulnain.stir.ac.uk...
Hi

I have a database which logs the usage of rooms. Some booking are entered
well in advance, and some have stays of more than six months.

I would like to ensure that rooms which have been booked cannot be booked
again, i.e. cannot be booked in that date range


Take a look at this post

http://groups.google.com/groups?selm...%40news2.calga
ry.shaw.ca&rnum=7

If that doesn't do it for you, search this newsgroup on Google for posts
by that articles author using reservations as a key word.

Nov 12 '05 #2

P: n/a
"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message
news:ba*******************@twister.nyroc.rr.com...

"Grant" <ja*********@hotmail.com> wrote in message
news:c0**********@dulnain.stir.ac.uk...
Hi

I have a database which logs the usage of rooms. Some booking are entered well in advance, and some have stays of more than six months.

I would like to ensure that rooms which have been booked cannot be booked again, i.e. cannot be booked in that date range
Take a look at this post

http://groups.google.com/groups?selm...%40news2.calga ry.shaw.ca&rnum=7


Isn't that a beautifully simple solution? Exactly the sort of thing that
reminds me I'll never make it as a mathematician. I'm the one that would
have ended up with a
If ...then
If...then
If then

nested to umpteen levels.
Nov 12 '05 #3

P: n/a
Mike, et al.
Available rooms is an outer join between booking dates and rooms. You need
a rooms table, a booking dates table and an intersection entity that lists
booked dates/rooms. Then it's an easy bit of SQL looking for dates in
booked dates/rooms by room where date is null for the requested dates.
Similar SQL can present to the requester the available dates/rooms.
I did a sample db some time ago which demonstrated this and could do it
again if there is interest. It'd be a fun weekend project.
"Mike MacSween" <mi***********************@btinternet.com> wrote in message
news:40**********************@news.aaisp.net.uk...
"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message
news:ba*******************@twister.nyroc.rr.com...

"Grant" <ja*********@hotmail.com> wrote in message
news:c0**********@dulnain.stir.ac.uk...
Hi

I have a database which logs the usage of rooms. Some booking are entered well in advance, and some have stays of more than six months.

I would like to ensure that rooms which have been booked cannot be booked again, i.e. cannot be booked in that date range


Take a look at this post

http://groups.google.com/groups?selm...%40news2.calga
ry.shaw.ca&rnum=7


Isn't that a beautifully simple solution? Exactly the sort of thing that
reminds me I'll never make it as a mathematician. I'm the one that would
have ended up with a
If ...then
If...then
If then

nested to umpteen levels.

Nov 12 '05 #4

P: n/a
Thanks Mike and Alan

Hope the interest is there for your 'weekend project' Alan

Grant
"Alan Webb" <kn*****@hotmail.com> wrote in message
news:7q****************@news.uswest.net...
Mike, et al.
Available rooms is an outer join between booking dates and rooms. You need a rooms table, a booking dates table and an intersection entity that lists
booked dates/rooms. Then it's an easy bit of SQL looking for dates in
booked dates/rooms by room where date is null for the requested dates.
Similar SQL can present to the requester the available dates/rooms.
I did a sample db some time ago which demonstrated this and could do it
again if there is interest. It'd be a fun weekend project.
"Mike MacSween" <mi***********************@btinternet.com> wrote in message news:40**********************@news.aaisp.net.uk...
"rkc" <rk*@yabba.dabba.do.rochester.rr.bomb> wrote in message
news:ba*******************@twister.nyroc.rr.com...

"Grant" <ja*********@hotmail.com> wrote in message
news:c0**********@dulnain.stir.ac.uk...
> Hi
>
> I have a database which logs the usage of rooms. Some booking are

entered
> well in advance, and some have stays of more than six months.
>
> I would like to ensure that rooms which have been booked cannot be

booked
> again, i.e. cannot be booked in that date range

Take a look at this post

http://groups.google.com/groups?selm...%40news2.calga
ry.shaw.ca&rnum=7


Isn't that a beautifully simple solution? Exactly the sort of thing that
reminds me I'll never make it as a mathematician. I'm the one that would
have ended up with a
If ...then
If...then
If then

nested to umpteen levels.


Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.