Posted 03 April 2008 - 07:21 AM
Well, I'm looking for a way to fill in some fields in a database automatically using SQL. I'll explain better:
Well, I'm making a video rental database. Each movie has a copyID with an hireband associated to it (The hireband determines how much the customer pays and how long they get the movie for). When the cashier enters the CopyID, I would like to be able to grab the hireband from the database then using something like an if statement to determine how long the movie can be rented for. So if for say:
They enter the CopyID as 'CO101', a piece of code (SQL), would get the HireID for the movie (which say is '1', this can be rented for 2 days) and then add 2 days to the current day (So if rented 3/4/2008, would calculate return as being 5/4/2008). I know how I could write the SQL, I'm just not sure how I get the field to automatically update itself with a query.
I'm not even sure this can be done in Access 2007, (which I'm required to use).
Any help would be great =]