Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

finding a date in the Access database

im writting a Motel programming used for bookings rooms

Description:
the Client books a room for a number of days, the program checks to see if that room is free on the particular date chosen .

eg 29/7/02 and staying for 3 nights

i need to add the 3 nights to the date ( 29/7/02 ) and check if that room will be available for those nights

*How will i code the SQL Query statement ??????

*How will i add 3 nights to the date 29/7/02

Comments

  • infidelinfidel Member Posts: 2,900
    : im writting a Motel programming used for bookings rooms
    :
    : Description:
    : the Client books a room for a number of days, the program checks to see if that room is free on the particular date chosen .
    :
    : eg 29/7/02 and staying for 3 nights
    :
    : i need to add the 3 nights to the date ( 29/7/02 ) and check if that room will be available for those nights
    :
    : *How will i code the SQL Query statement ??????
    :
    : *How will i add 3 nights to the date 29/7/02

    How are you keeping track of bookings? Do you store a three night booking as one booking or three room-nights?
  • HeineHeine Member Posts: 20
    Hi

    To add on days, months or years onto an existing date, look at the
    "DateAdd" function in VB.
    It will be something liek this:

    dim OldDate as date
    dim NewDate as date

    OldDate = CDate("29/07/2002")
    NewDate = DateAdd(OldDate,3,"d") can also try "dd"

    This will add 3 days to the existing date and give you a new date.

    It is always good practice to include centuries because of Y2K issues.

    Heine





    : im writting a Motel programming used for bookings rooms
    :
    : Description:
    : the Client books a room for a number of days, the program checks to see if that room is free on the particular date chosen .
    :
    : eg 29/7/02 and staying for 3 nights
    :
    : i need to add the 3 nights to the date ( 29/7/02 ) and check if that room will be available for those nights
    :
    : *How will i code the SQL Query statement ??????
    :
    : *How will i add 3 nights to the date 29/7/02
    :

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    ____ ( http://forcoder.org ) free ebooks and video tutorials about // Swift Java Objective-C PL/SQL Assembly Visual Basic Scratch R Delphi C# Go JavaScript Ruby Perl C Python PHP MATLAB Visual Basic .NET C++ Awk Prolog FoxPro D Rust ABAP Erlang Fortran COBOL Dart ML Hack Alice Transact-SQL Lua Crystal Bash SAS Julia Kotlin Scheme Clojure VBScript Logo Scala LabVIEW F# Apex Ada Lisp // __________

Sign In or Register to comment.