• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1245
  • Last Modified:

Alter Table Add Column

I have an Access Query that adds a new column to an existing table.  My code is:

ALTER TABLE abc ADD COLUMN salary number;

However, I also wanted to include the following format for the datatype "number":

FieldSize = Decimal
Format = Fixed
Precision = 13
Scale = 2
Decimal Places = 2

Is there a way to include these specifications in the query?  I know I can change the settings manually in the Access table afterwards but since the query is run inside a VBA (stand alone project), no user override is alowed.
  • 2
1 Solution

ALTER TABLE abc ADD COLUMN salary number(15, 2);
AugustineWanAuthor Commented:
I tried:

ALTER TABLE abc ADD COLUMN salary number(15, 2); and
ALTER TABLE abc ADD COLUMN salary number(15. 2);

Both gave me "Syntax Error".
Use square brackets:
ALTER TABLE abc ADD COLUMN salary number[15, 2];
I answered the question
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now