I need a function with Dates

  • Thread starter Thread starter Jimmy
  • Start date Start date
J

Jimmy

Hello.
In a form we enter two dates. Hotel Check-In Date and Hotel Check-Out Date.
We need to have in a new field how many days he stayed in the hotel, a
simple number that will come from the abstraction. And it should be saved
somewhere in the querie for every record. Please step by step instruction if
possible since I am a newbie.
Thank you in advance
Jimmy
 
There should be no reason to "save" the number of days since you can always
calculate it with an expression like:
DaysStay: [CheckOutDate]-[CheckInDate]
You can also use the DateDiff() function.
 
Jimmy,

I have a room reservations module that could be implemtented in your
database. You enter a date and all your rooms are graphically displayed on
the screen showing which rooms are occupied on tha date. You can click on
any reserved room to get all the details of the reservation and you can
click on an unreserved room to find out when that rom is next reserved.

If you are interested in having this module implemented in your Hotel
database, contact me at my email address below.
 
Hello.
In a form we enter two dates. Hotel Check-In Date and Hotel Check-Out Date.
We need to have in a new field how many days he stayed in the hotel, a
simple number that will come from the abstraction. And it should be saved
somewhere in the querie for every record. Please step by step instruction if
possible since I am a newbie.
Thank you in advance
Jimmy

Just calculate this dynamically as needed. Base a Query on your table;
in a vacant Field cell type

DaysStayed: DateDiff("d", [Hotel Check-In Date], [Hotel Check-Out
Date])

This field should NOT be stored anywhere since it can be recalculated
as needed.

John W. Vinson[MVP]
 
Back
Top