You can use TYPE() function to check if field exists and ALTER TABLE command to add it if it doesn't. Something like
IF TYPE("mytable.myfield") = "U"
ALTER TABLE mytable ADD COLUMN myfield C(10)
ENDIF
>Hello all,
>
>I need code that will do the following:
>
>1. Check to see if a column (field) exists in a table.
> 1a. If the column does exist, then exit.
> 1b. If the column does NOT exist, then add the column to the table.
>
>
>Any help will be appreciated.
>Thanks,
>Billy
--sb--