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

You guys truly have the best support and customer service. I wasn't ready to switch software because of the fear of starting over, but you exceeded my expectations in the support and training. AccuZIP is the best & Eric you are so helpful and so knowledgeable. You have gone above and beyond to help me and it's appreciated more than you know. I will always be an AccuZIP customer
C.C., Tucson, AZ