I don't know if it's possible so my question may sound stupid. I am wondering if I can use constraints in column containing integer data type. The value should be
not < 12 and not > 36 for instance. Is that possible? Thank you.
I don't know if it's possible so my question may sound stupid. I am wondering if I can use constraints in column containing integer data type. The value should be
not < 12 and not > 36 for instance. Is that possible? Thank you.
Did you try anything? What were the results?Is that possible?
If you mean a field in a table, then try putting "Not < 12 And Not > 36" in the Validation Rule property in the table design view.
I don't use the Validation Rule property; instead, I prefer to use the form Before update event to validate values.
Thanks for your help. I tried that, the access said it's too complex, try simplifying by assigning values to the variables....
In a query, you could use constraints along this set up
SELECT your fields
FROM YourTable(s)
WHERE intValue BETWEEN 12 AND 36
I read you were trying to limit the values in a field by setting a validation rule in a table.
I think I misunderstood what you were asking...
orange has the correct answer.
As an explanation, you understand what "not < 12 and not > 36" means.
But the computer does not. You have to compare each part to a field. So if the integer field is named "intMyField", the computer needs
WHERE intMyField Not < 12 AND intMyField Not >36
Or you could write it:
WHERE intMyField >11 AND intMyField < 37
Or as orange provided:
WHERE intMyField BETWEEN 12 AND 36
But this will not work:
WHERE intMyField Not < 12 AND Not >36