Skip to main content

Below is the calculation I created. Although the calculation shows as valid, the resulting field does not include the desired dash for 9-digit zip codes.

 

IF REGEXP_MATCH ([Zip],'[0-9]{5}')

 

THEN [Zip]

 

ELSEIF REGEXP_MATCH ([Zip],'[0-9]{9}')

 

THEN LEFT([Zip],5) + "-" + RIGHT([Zip],4)

 

END

7 respostas
  1. 22 de set. de 2021, 19:02

    So, looks like they are all either displayed as XXXXXXXXX or XXXXX. In that case, you can do this:

     

    // Format the zip code

    IF LEN([Zip])=5 THEN

    [Zip]

    ELSE

    LEFT([Zip],5) + "-" + RIGHT([Zip], 4)

    END

0/9000