Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Rule Validation -- Invalid SQL Syntax

Status
Not open for further replies.
Apr 10, 2007
4
US
Hello everyone,

I'm attempting to create the rule validation [End_Date]>[Start_Date] but I am receiving the following error:

"Invalid SQL Syntax - cannot use multiple columns in a column-level CHECK constraint."

I have been told there is a way to create a rule validation like this in Access 2003, but I am not sure how to do it. I have attempted creating this validation at the table level, but the rule validation is not enforced. Does anyone know how to create the validation?

Thanks for your time and assistance!
 
I was able to create a table validation rule of
[End_Date]>[Start_Date]
It worked as expected.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks for the reply dhookom,

Unfortunately, I am still receiving this error. Does anyone know why I might be receiving it? Or have a solution for it?

Thanks for your time and help!
 
I am still receiving this error
Which error ? I can't believe the same as in your original post since you now know that you have to play with a TABLE validation rule !
So, please, tell us exactly what you've tried and what is going wrong.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for the reply PHV,

Yes, I realize that I need to play with the Table validation rule, but it is not working for me. If I insert the table validation rule:

[End_Date]>[Start_Date]

The rule is not reinforced and I can enter data that this rule does not allow. Is there something I am not doing correctly to make a table validation rule?

Thanks for your help!
 
Just to be sure:
[End_Date] and [Start_Date] are both DateTime fields ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hello PHV,

Glory and Wonder! It works! That was exactly the problem. There was a data type mismatch between the two date fields that I had been missing.

Thanks for the help PHV! =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top