Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query

Status
Not open for further replies.

zrazzaq

MIS
Apr 13, 2005
102
US
Hi:
I have a field that represents Social Security numbers. I need to update the field by an update query as:
XXX-XX-XXXX
it comes in as XXXXXXXXX
Can someone help me out.
Thanks
Z
 
Try

Left([SS], 3) & "-" & mid([SS], 4, 2) & "-" & right ([SS], 4)

ChaZ



There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
is it a numerical field or a text field? you can't store the '-' in a numerical field.

I usually go by the rule, if you aren't going to perform a mathematical calculation on it, it shouldn't be a number. Zipcodes, Social Security Numbers, PhoneNumbers, etc. How often do you add up zipcodes or SSN?

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
And what about a display format like ###-##-####

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Can you try the input mask. The input mask let's you chose this option: Social Security Number 000-00-0000
Ismail
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top