Support 805.461.7300
Sales
Our Technology. Your Success.

Delete a field if the field is blank for all records

*!* 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

Tech Support always answers quickly and never makes me feel inadequate or stupid for asking the questions that I do...I am very pleased with the software and the way it works.
C.M., Merrillville, IN