Welcome Guest, Not a member yet? Register   Sign In
Custom Rental Diary
#3

[eluser]gRoberts[/eluser]
What you need to do is have a table that contains a link between the vehicle and the dates it's taken.

i.e.

Code:
create table VehicleUsage
(
VehicleUsageID int not null,
VehicleID int not null,
StartDate int not null,
EndDate int not null
)

then, when you "rent" out a car, you simply insert the vehicle id and the dates in which the vehicle is rented out between, i.e.

Code:
insert into VehicleUsage (VehicleID, StartDate, EndDate) values (1, 1336643788, 1336989388)

The above says, that VehicleID `1` is rented out between 10th May and 14th May.

From there, you can use an SQL Query to select all vehicles that are being rented out during those two dates.

Hope that helps?


Messages In This Thread
Custom Rental Diary - by El Forum - 05-13-2012, 01:11 AM
Custom Rental Diary - by El Forum - 05-13-2012, 03:09 AM
Custom Rental Diary - by El Forum - 05-14-2012, 03:05 AM
Custom Rental Diary - by El Forum - 05-14-2012, 04:52 AM
Custom Rental Diary - by El Forum - 05-14-2012, 05:21 AM
Custom Rental Diary - by El Forum - 05-14-2012, 06:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB