Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT Zipcode FROM MyTable WHERE "-" $ zipcode
SELECT Zipcode FROM MyTable WHERE LEN(ALLTRIM(Zipcode)) > 5
mcCityStateZip = 'SANTA BARBARA CA 93108 1048'
DO CASE
CASE '-' $ mcCityStateZip
* --- Dash between Zip & Zip4 ---
mnLoc = RAT("-",mcCityStateZip)
mcCityStateZip = LEFT(mcCityStateZip,mnLoc-1)
CASE SUBSTR(mcCityStateZip,LEN(mcCityStateZip)-4,1) = " "
* --- Space between Zip & Zip4 ---
mnLoc = RAT(" ",mcCityStateZip)
mcCityStateZip = LEFT(mcCityStateZip,mnLoc-1)
OTHERWISE
* --- No Zip4 - Leave Alone ---
ENDCASE
mcZipcode = RIGHT(mcCityStateZip,5)
USE yourTable
SCAN
lnLength = LEN(RTRIM(yourField))
lnSpacePosition = RAT(CHR(32), RTRIM(yourField))
IF lnLength - lnSpacePosition = 4
? yourField
? LEFT(yourField, lnSpacePosition - 1)
ENDIF
ENDSCAN
oRE = CreateObject("VBScript.RegExp")
oRE.Pattern="\d{5}[-| ]\d{4}"
Set Filter To oRE.Test(citystzip)