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

  • : 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?
  • 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
    :

Sign In or Register to comment.

Howdy, Stranger!

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

Categories