deego55 Posted May 31, 2006 Share Posted May 31, 2006 I think i am missing something obvious, but how do you set a field so that it must contain a specific number of characters? i.e. only three digit numbers? Link to comment Share on other sites More sharing options...
Razumovsky Posted May 31, 2006 Share Posted May 31, 2006 You are asking for two different things: length(field)=x would be for a specific number of characters (swap x for 3). But, this would also allow values that are not three digit numbers, like "HAT". Do you need it to be only numbers? Decimal values OK (would make a three digit number more characters...)? -Raz Link to comment Share on other sites More sharing options...
deego55 Posted May 31, 2006 Author Share Posted May 31, 2006 would length(getasnumber(field)) solve to only allow numbers? i hadnt thought of decimals, but there will never be an instance when they are needed. basically i have a lot of fields that require either two, three or four digit whole numbers. i dont want to allow any other values in these fields. sorry if i dont explain this well! Link to comment Share on other sites More sharing options...
Razumovsky Posted May 31, 2006 Share Posted May 31, 2006 For three digits; how about setting as a number field and: field>=100 and field <=999 and Int(field)=Field Link to comment Share on other sites More sharing options...
deego55 Posted May 31, 2006 Author Share Posted May 31, 2006 hey that is slick, but what if the number is 001? would that still work if i changed to >=001? these are specific codes so even if it is a single digit number, the leading zeros have to be there. thanks! Link to comment Share on other sites More sharing options...
comment Posted May 31, 2006 Share Posted May 31, 2006 Why not check the "Numeric Only" option, then add a calculation of Length (field) = n? Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6533 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now