Solved

Alter Table Add Column

Posted on 2004-04-08
7
1,174 Views
Last Modified: 2007-12-19
Hi:
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.
0
Comment
Question by:AugustineWan
  • 2
7 Comments
 
LVL 8

Expert Comment

by:william_jwd
Comment Utility
try,

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

Author Comment

by:AugustineWan
Comment Utility
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".
0
 
LVL 18

Accepted Solution

by:
Sethi earned 100 total points
Comment Utility
Use square brackets:
ALTER TABLE abc ADD COLUMN salary number[15, 2];
0
 
LVL 18

Expert Comment

by:Sethi
Comment Utility
I answered the question
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now