Page 1 of 1

Delete a field if it's empty for every record

Posted: Thu Jan 03, 2008 9:20 am
by Eric
The command below will delete the Address2 field whenever that field has no data in it for every record in the database.

Code: Select all

com_field="ADDRESS2"
COUNT FOR !EMPTY(&com_field) TO com_emptycount
com_deletefield=IIF(com_emptycount=0,"ALTER TABLE (ALIAS()) DROP COLUMN &com_field","")
&com_deletefield