Reputation: 11
I need to set up a small database as an assignment after 3 hours of an access introduction and I'm failing completely. However I youtubed several hours but still no change in the outcome. Do I try to implment too many excel functions into access?
My question / problem:
I have three tables for a dvd rental business. Customers, Movies, Rentals.
Start and end date of rented movie, both data type "Date/Time
" Start Date should be today by default; validation rule: =Date() End date
should be equal or after
start date; validation rule: =[Enddate]>=[Startdate]
I'm gettint an error messasge:
invalid SQL syntax - cannot use multiple columns in a column-level CHECK constraint.
I'm setting it up in the table properties not in the field, so what am I doing wrong?
Upvotes: 1
Views: 11624
Reputation: 2013
When you receive the error message: invalid SQL syntax - cannot use multiple columns in a column-level CHECK constraint.
you are trying to add multiple columns as validation within a Field
validation rule. In the table design view this is the box at the bottom with tabs for General and Lookup.
To apply a constraint that uses multiple columns you must do so at the table level. This can be access by right clicking your table while in design view and selecting properties to open up the Property Sheet. Once this is open you can place your check into the available Validation Rule field but put it in brackets without an equal sign: ([Enddate]>=[Startdate])
Upvotes: 3