Build your list of AccuZIP6 commands by requesting commands and sharing commands with other users
Moderators: Chrissy, Steve, Terry, Donna, Dave, Eric, MartyH, Kristen, Geoff, Vince
- Site Admin
- Posts: 620
- Joined: Wed Sep 20, 2006 3:20 pm
Copy the following command into the command statement syntax area from the Edit>Command option, then click RUN.
The command will create a new -ZIP5_COUNT.XLS file in the same location as the original file with the count on 5 digit zips.
Code: Select all
ON ERROR com_message=message()
SET SAFETY OFF
alter table alias() add column zip5 c(5)
replace all zip5 with left(zip,5)
SELECT zip5, city, st, count (zip5) as zipcnt ;
from (com_alias) group by 1,2,3 into table FORCEEXT(DBF(),"")+"-zip5_count"
copy to FORCEEXT(DBF(),"XLS") type XLS
delete file FORCEEXT(DBF(),"")+"-zip5_count.dbf"