Linking tables

WJReid

Active Member
Joined
Jul 26, 2002
Messages
317
Hi All,

I have a database that includes two tables, one for contract dates and one for vehicles. I need to know which vehicles are available during the contract dates. At the moment, I have fields in the Contract table of ContractNo, ContractStart, ContractEnd. In the Vehicles table, I have VehicleNo, VehicleType. I need to allocate vehicles to contracts, so the vehicle is not available to any other contracts during those allocated dates. Whenever I have a new contract, I need to know which vehicles are available during the contract dates, but I don't know how to go about it. Does anyone have any ideas?

Thanks in advance for any help.

Regards,

Bill
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Personally, I'd probably add Vehicle # as a foreign key to your Contracts table. Then you could query on vehicles that do not have a Contract End Date after (Today)...

HTH,

Russell
 
Upvote 0
Hi Russell,

Thanks for the reply. Would it matter if a contract could have many vehicles added to it or if a vehicle could be allocated to many contracts at different times?

Regards,

Bill
 
Upvote 0
Yes, it would matter very much. Since it is very early in the morning here, let me stew on that one for a while. Also, I'm leaving early today so it will most likely be tomorrow...
 
Upvote 0
Hi Bill,

This is hard to determine when I don't know about your system of allocating the vehicles. But if you can put a date/time field in for when the vehicle is reserved from and to (so 2 fields, like OUT and IN), then you should be able to query off of that...

HTH,

Russell
 
Upvote 0

Forum statistics

Threads
1,221,503
Messages
6,160,195
Members
451,630
Latest member
zxhathust

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top