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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field does not keep format change in table when running query 1

Status
Not open for further replies.

Freefall69

Technical User
Apr 29, 2013
37
US
I am using Access 2007 on Windows 7 and have the following issue. I pulled data from our billing system and the phone number is in two fields and drops leading zeros if they exist in field PHSFX

Example:
Table - CustInfo
Field 1 - PHPRFX - 720345
Field 2 - PHSFX - 35 (really should be 0035)

I fixed field (PHSFX) in table (CustInfo) by running SQL QRY:
UPDATE CustInfo SET PHSFX = format(PHSFX, '0000');

That worked and changed the PHSFX field to four digits in table.
Table - CustInfo
Field 1 - PHPRFX - 720345
Field 2 - PHSFX - 0035

I then built a query to Concatenate the fields. I need the full 10 digit number to match against another table which contains the field in 10 digit format already.

Tendigit: [PHPRFX] & "" & [ PHSFX]

I am getting the 72034535 (not including the leading zeros) in Concatenated field.

Can someone assist with helping me figure out how to make this work correctly. I have tried a few things but have not had luck.
 
Tendigit: [PHPRFX] & Format([PHSFX],'0000')

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top