By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Validation rule for decimals

P: 76
Hello,

I'm trying to set a validation rule for a field in a table that will only allow the user to enter whole hours or quarter hour increments, like 1 or 2.25. I'm using the following statement in the validation rule field:

Like "*.0" Or Like "*.25" Or Like "*.5" Or Like "*.75"

but it isn't working. When I enter 1.0, I would think that it should work, but it denies it. Why is it denying it and what can I put in instead?

Thanks,

Charlie
Sep 14 '07 #1
Share this Question
Share on Google+
2 Replies


FishVal
Expert 2.5K+
P: 2,653
Hello,

I'm trying to set a validation rule for a field in a table that will only allow the user to enter whole hours or quarter hour increments, like 1 or 2.25. I'm using the following statement in the validation rule field:

Like "*.0" Or Like "*.25" Or Like "*.5" Or Like "*.75"

but it isn't working. When I enter 1.0, I would think that it should work, but it denies it. Why is it denying it and what can I put in instead?

Thanks,

Charlie
Hi, Charlie.

Try the following validation rule
[Your Field Name]/0.25=Int([Your Field Name]/0.25)
Sep 14 '07 #2

P: 76
Awesome, that worked perfectly. Thanks so much for the help.
Sep 14 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.