youronmyfoot
2009-04-10 05:19:56 UTC
new_veh_tbl
veh_reg(primary key) depot_id chassis_number year make model mileage veh_notes
inspection_tbl
Veh_id(primary key) comp_mot_date comp_tax_date comp_loler_td comp_twoyr_td comp_sixyr_td
inspec_tbl
Veh_id mot_dd tax_dd loler_test_dd 2yrtaco_dd 6yrtaco_dd notes
history_tbl
Veh_id service_date service_item labour_hours labour_rate invoice_no notes service_cost total_servicecost_todate
Basically I want the user to click a button and perform a search on the databse. I want the user to be able to see records of a vehicle inspection in date order. I will build the SQL query for this.
The problem I have is understanding how I can store the information in a table. Basically a vehicle has to have an annual mot inspection. I allow for this in my current table that has a field for the next inspection date and the last date of the inspection.
Could I incorporate an archive table that holds all of the previous completed mot dates? The problem is that I am unsure of a primary key that this table would use? Does a table have to have a primary key?
Hope you can help. Or if you could point me in the right direction.