I have three tables in my database that I use for renting out products. The products in "tblProducts", the orders in "tblOrders" and a junction table "tblBookinglist" that saves ProductNo (from tblProducts), OrderNo (from tblOrders), and OutDate and Indate.
To be able to produce a list of available products for new orders I want to use a query to populate a listbox.
The query needs to show all the products that exist in the tblProducts but not in the tblBookings (as they are not booked at all). However, if a product exist in tblBookings, it should still be shown if the OutDate and InDate differs from what I am having in my order form.
Is this possible at all to accomplish with a query or do I need to get my nose in to complicated SQL code?
To be able to produce a list of available products for new orders I want to use a query to populate a listbox.
The query needs to show all the products that exist in the tblProducts but not in the tblBookings (as they are not booked at all). However, if a product exist in tblBookings, it should still be shown if the OutDate and InDate differs from what I am having in my order form.
Is this possible at all to accomplish with a query or do I need to get my nose in to complicated SQL code?