A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Validation Rule



 
 
Thread Tools Display Modes
  #1  
Old June 23rd, 2004, 01:21 PM
external usenet poster
 
Posts: n/a
Default Validation Rule

I need to create a validation rule with the following
parameters. It is a text field with numeric characters
and it is required to be 9 characters long. Here is what
I think it should look like, but it does not work.

Like "01???????"-"15???????"or"21???????"-
"32???????"or"61???????"-"72???????"

Any ideas please?
  #2  
Old June 23rd, 2004, 05:51 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default Validation Rule

" wrote
in :

Here is what
I think it should look like, but it does not work.

Like "01???????"-"15???????"or"21???????"-
"32???????"or"61???????"-"72???????"



VAL(MyField) BETWEEN 100000000 AND 159999999
OR VAL(MyField) BETWEEN 210000000 AND 329999999
OR VAL(MyField) BETWEEN 610000000 AND 729999999

Note: if any of the chars are non-digit, then the remaining number won't be
big enough for any of the ranges.

Note 2: you might want to catch the error like 123456789ABC, which will
pass this test: either set the field length to 9, or add a constraint like

LEN(MyField)=9 AND
( VAL(MyField) BETWEEN 100000000 etc. etc.


Hope that helps

Tim F



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:28 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.