Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Wanted...please!!

Status
Not open for further replies.

allard

Technical User
Jan 3, 2001
11
0
0
NL
I need to make a database for school, about an Hotel. Ive got two tabels. Reservations and Clients. "Reservation" has got dates before and after this date (2000,2001 and 2002).
Now I need to make a querie, which tells me the number of times a client visited/or gonna visit my hotel. I want these two numbers (visited and gonna visit/reservations) to be seperated. But most of all I want them to adapt with the date. Automaticly off course.
And is there a way to do the same with the tabels. To split the reservation into past and future reservaation, adapting to the present date? Please help.

O yeah. BTW, Im not sure if this is the place for a newbie like me to post my threads. So coorect me if Im wrong.
Thanks
 
You will need to make two queries. One that pulls past and one that pulls future. You can use the Date() function to get the current date. You will need to decide whether you want the current day to be included in the past reservations or the future. That will make a difference in you criteria expression i.e.

<= date()

or

< date()
Mike Rohde
rohdem@marshallengines.com
 
In my amateur opinion, The template for a contact management database can be used to show a one to many relationship- one client-many relationships. Instead of starting with a blank database, chose the one for contact management and adapt it it the design mode to fit your needs. Good luck!
 
Allard,re: spliting tables into past/future according to present date

Although you can write some visual basic scripts to move lines from one table to another according to each lines date, and make this script run once every day, I think that this approach may be more hassle than help for what you need.

You can have reservations entered into one table, and use a query (as per Rohdem) to view just the future bookings or just the past bookings

--
Steve Root
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top