Support 805.461.7300
Sales
Our Technology. Your Success.

Delete a field if the field is blank for all records

Here is the command to delete a field (column) from the database if all of the records are blank in that field.

*!* Get Field Name
com_FieldName="myField"

*!* Count records that are not empty
COUNT FOR !EMPTY(&com_FieldName) TO com_Count

*!* Create a Delete Column String if Count is 0
com_AlterString=IIF(com_Count=0,[ALTER TABLE (ALIAS()) DROP COLUMN &com_FieldName],[])

*!* Run AlterString line
&com_AlterString

« Back to Commands

We have partnered with AccuZIP for several years, and they clearly are the best. The software is second to none and what is even better is the support they offer. Their team provides the best customer service and they are able to help us with every challenge and question we have asked. We all know that the mailing and USPS guidelines can be complex, but with AccuZIP we have a competitive edge against our competition. If you want to succeed in direct and EDDM mailing, go with the best strategic partner in the business, AccuZIP!
J.P., Bradenton, FL