Using date and a value to make a text box true

spn200286

Registered User.
Local time
Today, 21:49
Joined
Feb 7, 2005
Messages
56
Hey all, i got another small problem with this bloody database!

The problem today folks is this, im making a booking system (well the booking is a small part of the overall system) so i have DateArrive, RoomID, and all the usual.

now what i want is to make a query that says
if DateArrive & RoomID (Booking Table) then make RoomOccupied(Room Table) true

if that makes sense, i tried some in sql and got the date bit working, but wasn't sure how to go further so as to make it so RoomID is involved

(ill say in another way If a room is booked on a specific day i want to make Occupied true)

thanks for anymore help u can give
 
I would say the room is not occupied until the client "checks in".
 
To carry Allan's comment a step further, I'd want to insert a mechanism to show a yet to be occupied room as reserved, thus ensuring the room is not double-booked.

Bob
 
not quite what i meant, ill try again below is teh tables i have
RoomAvaliableBooking.jpg

what i want is when date is today occupied to room to become true
i have the SQL

SELECT Room.RoomID, Booking.DateArrive
FROM Room INNER JOIN Booking ON Room.RoomID=Booking.RoomID
WHERE (((Booking.DateArrive)=Date()));

but want to extend for something like
Update Room
Set Occupied = true
where (Select DateArrive FROM Booking WHERE (((Booking.DateArrive) = Date()))

if that makes sense

or have i missed a point you have made
 
I believe the point both of us were trying to make is that if this is a real world application then the room does not become occupied automatically as you are trying to do. It is a manual process.
 
I believe the point both of us were trying to make is that if this is a real world application then the room does not become occupied automatically as you are trying to do. It is a manual process.

Ah ok, just thought it would be nice to have it done automatic, ill just keep it manual then, was just thinking it would make it easier.

i now see what you ment by reserved option

cheers
 
Easier is fine as is automatic, unless doing so makes the data inaccurate.
 

Users who are viewing this thread

Back
Top Bottom