Availability query(Help with syntax)

Discussion in 'Databases' started by lounar, Nov 29, 2007.

  1. #1
    bid --- 100
    bbdate --- 19/6/2007
    bdatein ---22/6/2007
    bdateout ---25/6/2007
    brid ---5


    bid --- 101
    bbdate --- 21/6/2007
    bdatein ---23/6/2007
    bdateout ---28/6/2007
    brid ---6


    ok now the sql query asks u to give 2 date the check in date and check out date.As the customer gives the dates he wants to visit the hotel the query gives the available rooms for that dates.Keep in mind that we dont refer to the exact dates of the rows shown up here we need a general statement that compares the dates that customer gives with the dates that rooms are booked!
     
    lounar, Nov 29, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    what is the BRID? I assume the BID is the Booking ID

    To be honest to do these sorts of queries properly are complicated and you would need to give the business rules (eg given checkout is normally AM and checkin PM can a checkout date and checkin date be the same? do all "rooms" hold the same number of people or is this another factor to consider?)
     
    AstarothSolutions, Nov 29, 2007 IP