Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ALTER TABLE query: decimal places 1

Status
Not open for further replies.

mekon

Technical User
Feb 13, 2002
21
GB
hi all

I'm having problems with an ALTER TABLE query. I'm using the basic Access 2000/sql query window setup..

as well as dozens of text fields, I need to add a double integer column with a fixed number of decimal places.

(I can do this in the table design view of course, but am looking at ways to save time as hundreds of tables need modifying)

ALTER TABLE master
ADD COLUMN
av_price DOUBLE;

I can't seem to find the syntax to specify the number of decimal places in the above query. is this possible, or are my options limited by Access 2000?

many thanks in advance

M
 
If you want fixed decimal places don't use DOUBLE which is a floating point number and is always an approximate. Try using number(p,s). Where p = precision and s = number the number of places after the decimal.

ALTER TABLE master
ADD COLUMN
av_price NUMBER(12,2);
 
thanks for your response. I'm still getting a "Syntax error in ALTER TABLE statement" error message though

M
 

Try numeric instead of number.

ALTER TABLE master
ADD COLUMN
av_price Numeric(12,2);
 
Hey Hi mekon

I was just wondering if you got that syntax error sorted?? As I too am having the same problem with decimals.


[yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top