Globally Check Format

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
 
J

John Vinson

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 "###-##-####"
 
L

Laura

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top