Globally Check Format

  • Thread starter Thread starter Laura
  • Start date Start date
L

Laura

Is there a way to globally check if a value has a certain format rather than to
check character-by-character?

For example, can a social security number value be globbally checked to see if
it has the format:
000-00-0000 where 0 indicates the character must be 0 to 9 and - indicates a
dash must be in that position?

I have a function to do it character-by-character but am wondering if it can be
done globally.

Thanks!

Laura
 
Is there a way to globally check if a value has a certain format rather than to
check character-by-character?

For example, can a social security number value be globbally checked to see if
it has the format:
000-00-0000 where 0 indicates the character must be 0 to 9 and - indicates a
dash must be in that position?

Yes: use the surprisingly powerful wildcards in the LIKE query.

To find all improperly formatted SSN's use a criterion of

NOT LIKE "###-##-####"
 
John,

You're amazing!!

Up til now I have only seen functions proposed as a solution - some quite
complicated.

I follow this newsgroup regularly and note that you very frequently provide
solutions that no one else ever thought of. Thanks for the time you devote to
the newsgroup.

Laura
 
Back
Top