Solved

Alter Table Add Column

Posted on 2004-04-08
7
1,188 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using "ScreenUpdating" 6 63
How does CurrentUser work? 10 37
How to compare ms sql hashbytes results within vb6 5 73
VBA - If Bookmark = "XXBOOKMARKXX" then 15 25
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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.
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 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…

786 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