Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Booking

Booking

Scheduled Pinned Locked Moved Database
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zeroonea
    wrote on last edited by
    #1

    i have a "Booking" table with 3 Column: BookingID (numeric - primary key) CheckInDate (datetime) CheckOutDate (datetime) - With input are indate and outdate, i want select out free date range in Booking table, like find free room for hotel booking Thanks.

    C 1 Reply Last reply
    0
    • Z zeroonea

      i have a "Booking" table with 3 Column: BookingID (numeric - primary key) CheckInDate (datetime) CheckOutDate (datetime) - With input are indate and outdate, i want select out free date range in Booking table, like find free room for hotel booking Thanks.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I don't see how you can do it with this, you don't have a room number in the table. Otherwise, you need to use the date functions in SQL to find which rooms are booked on a given date, or a given range, and return the other room numbers.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      Z 1 Reply Last reply
      0
      • C Christian Graus

        I don't see how you can do it with this, you don't have a room number in the table. Otherwise, you need to use the date functions in SQL to find which rooms are booked on a given date, or a given range, and return the other room numbers.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        Z Offline
        Z Offline
        zeroonea
        wrote on last edited by
        #3

        Can you show me some db design and algorithm about hotel booking? i tried search a hours but... Thanks.

        C D 2 Replies Last reply
        0
        • Z zeroonea

          Can you show me some db design and algorithm about hotel booking? i tried search a hours but... Thanks.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          I'm not really sure what to say. You should work through a book on database design, and think your problem through. The SQL Server help has all the info you need on how to use date functions.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          1 Reply Last reply
          0
          • Z zeroonea

            Can you show me some db design and algorithm about hotel booking? i tried search a hours but... Thanks.

            D Offline
            D Offline
            dayanandip
            wrote on last edited by
            #5
             :-O  :zzz:  :-\  :((  :-O  :omg: :mad::confused::~ :doh:
            
            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups