prohibit double booking in room hire database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Grant

    prohibit double booking in room hire database

    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


  • rkc

    #2
    Re: prohibit double booking in room hire database


    "Grant" <jamesbgrant@ho tmail.com> wrote in message
    news:c0srv0$na7 $1@dulnain.stir .ac.uk...[color=blue]
    > 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[/color]

    Take a look at this post


    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.





    Comment

    • Mike MacSween

      #3
      Re: prohibit double booking in room hire database

      "rkc" <rkc@yabba.dabb a.do.rochester. rr.bomb> wrote in message
      news:bapYb.7438 9$%72.65845@twi ster.nyroc.rr.c om...[color=blue]
      >
      > "Grant" <jamesbgrant@ho tmail.com> wrote in message
      > news:c0srv0$na7 $1@dulnain.stir .ac.uk...[color=green]
      > > Hi
      > >
      > > I have a database which logs the usage of rooms. Some booking are[/color][/color]
      entered[color=blue][color=green]
      > > 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[/color][/color]
      booked[color=blue][color=green]
      > > again, i.e. cannot be booked in that date range[/color]
      >
      > Take a look at this post
      >
      >[/color]
      http://groups.google.com/groups?selm...%40news2.calga[color=blue]
      > ry.shaw.ca&rnum =7[/color]

      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.


      Comment

      • Alan Webb

        #4
        Re: prohibit double booking in room hire database

        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" <mike.macsween. damnthespam@bti nternet.com> wrote in message
        news:403280f5$0 $4104$5a6aecb4@ news.aaisp.net. uk...[color=blue]
        > "rkc" <rkc@yabba.dabb a.do.rochester. rr.bomb> wrote in message
        > news:bapYb.7438 9$%72.65845@twi ster.nyroc.rr.c om...[color=green]
        > >
        > > "Grant" <jamesbgrant@ho tmail.com> wrote in message
        > > news:c0srv0$na7 $1@dulnain.stir .ac.uk...[color=darkred]
        > > > Hi
        > > >
        > > > I have a database which logs the usage of rooms. Some booking are[/color][/color]
        > entered[color=green][color=darkred]
        > > > 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[/color][/color]
        > booked[color=green][color=darkred]
        > > > again, i.e. cannot be booked in that date range[/color]
        > >
        > > Take a look at this post
        > >
        > >[/color]
        >[/color]
        http://groups.google.com/groups?selm...%40news2.calga[color=blue][color=green]
        > > ry.shaw.ca&rnum =7[/color]
        >
        > 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.
        >
        >[/color]


        Comment

        • Grant

          #5
          Re: prohibit double booking in room hire database

          Thanks Mike and Alan

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

          Grant


          "Alan Webb" <knogeek@hotmai l.com> wrote in message
          news:7qOYb.66$T L5.54470@news.u swest.net...[color=blue]
          > Mike, et al.
          > Available rooms is an outer join between booking dates and rooms. You[/color]
          need[color=blue]
          > 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" <mike.macsween. damnthespam@bti nternet.com> wrote in[/color]
          message[color=blue]
          > news:403280f5$0 $4104$5a6aecb4@ news.aaisp.net. uk...[color=green]
          > > "rkc" <rkc@yabba.dabb a.do.rochester. rr.bomb> wrote in message
          > > news:bapYb.7438 9$%72.65845@twi ster.nyroc.rr.c om...[color=darkred]
          > > >
          > > > "Grant" <jamesbgrant@ho tmail.com> wrote in message
          > > > news:c0srv0$na7 $1@dulnain.stir .ac.uk...
          > > > > Hi
          > > > >
          > > > > I have a database which logs the usage of rooms. Some booking are[/color]
          > > entered[color=darkred]
          > > > > 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[/color]
          > > booked[color=darkred]
          > > > > again, i.e. cannot be booked in that date range
          > > >
          > > > Take a look at this post
          > > >
          > > >[/color]
          > >[/color]
          >[/color]
          http://groups.google.com/groups?selm...%40news2.calga[color=blue][color=green][color=darkred]
          > > > ry.shaw.ca&rnum =7[/color]
          > >
          > > 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.
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...