Solved

Alter Table Add Column

Posted on 2004-04-08
7
1,203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 8

Expert Comment

by:william_jwd
ID: 10784382
try,

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

Author Comment

by:AugustineWan
ID: 10784421
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
ID: 10788762
Use square brackets:
ALTER TABLE abc ADD COLUMN salary number[15, 2];
0
 
LVL 18

Expert Comment

by:Sethi
ID: 11262003
I answered the question
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

752 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