How to "pad" a field

  • Thread starter Thread starter Darrell Childress
  • Start date Start date
D

Darrell Childress

I have a table that contains a field called CustNo (Customer No). The
customer numbers are either 3- or 4-digit. I need to take all the
records that contain a 3-digit customer number and add a zero (0) to the
beginning. The field is formatted as text, by the way. For example, I
need to "convert" customer number 315 to 0315, but leave customer number
1214 as 1214. I do NOT want to just add a 0 to the beginning of each
record. The field length is 10.
Thanks for any help,
Darrell
 
You can create an Update Query and use the following in the Update to: row

Format([Customer No],"0000")
 
Back
Top