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

I just wanted to let your team know how much I appreciate you. I'm still fairly new at doing mail data processing, and it if weren't for your active support -- even for the not so smart questions -- I probably wouldn't be doing as well in this job as I am now. I have much more to learn as I have seen, but I just wanted to say thank you for your help! You all are wonderful!
T.B., Greenville, SC