Firstly, I recommend not using the Decimal data type in Access 2003, because there are errors with it when sorting (wrong order) and aggregation (amounts truncating the fractional part). In Access 2007, the general problem is solved, but not sorting (although you can probably fix this in Access 2007 by specifying the index in the column).
As for your script, there are two obvious problems:
You must use ADD COLUMN ColumnName not ADD ColumnName
The correct Decimal data type is because NUMBER instead creates a double precision float and does not allow parentheses after specifying any size. (Maybe NUMERIC will work as a synonym for Decimal , but I don't know.)
So this should work for you:
ALTER TABLE EMP_2 ADD COLUMN EMP_PCT DECIMAL(4,2);
According to HansUp and other sources, this cannot be sent via DAO (as in CurrentDb.Execute ), but must be done via ADO ( CurrentProject.Connection.Execute ).
There seems to be a way to make this SQL work , but it requires changing the database settings:
The decimal data file type is not supported in the default MDd file of Jet 4.0. You must use SQL Server Compatibility Syntax (ANSI 92) to use the decimal data type in the SQL window.
Select the menu, Tools> Options. Click the Tables / Query tab. Check the box next to "This Database" in SQL Server Compatibility Syntax (ANSI 92). This mode will affect the entire db, including wildcard queries, so you can try this on a copy of your db.
If you still can't get it to work, you can consider this method ( thanks to Philippe Grondier ):
Dim TD As DAO.TableDef Dim F As DAO.Field Set TD = CurrentDb.TableDefs("TableName") Set F = TD.CreateField("FieldName", dbDecimal, 4) F.DecimalPlaces = 2 F.DefaultValue = 0 TD.Fields.Append F
For reference, here are some related Microsoft.com help pages: