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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new field using ALTER

Status
Not open for further replies.

dc20

Technical User
Dec 15, 2003
95
US
I get syntax error in field definition running this in an Access Query (sql) and highlights decimal.

ALTER TABLE VENDORS
ADD last_column decimal(6,2);

I've tried various forms of it and if I use "int" instead of "decimal(6,2)", then it works ok. One of the books I'm reading leads me to believe decimal is a valid. I tried "numeric(6,2)" also, that gives a syntax error too.

I also see them listed here too under datatypes..
 
Well, I just got "numeric" and "number" to work (below), but it doesn't specify number of decimals. I guess that could be done with properties, but I don't understand why I see references to specifying # of decimals in the sql unless it's not applicable to Access.

ALTER TABLE VENDORS
ADD last_column numeric;

ALTER TABLE VENDORS
ADD last_column number;
 
Try and use the Float data type:

ALTER TABLE VENDORS
ADD last_column Float;

You can't specify the size (or decimal places) of numbers, that's why they have so many different types.

You should look up SQL Data Types in the help file.

John
 
I did some lookups of data types for sql and that's where I got the impression I could include a decimal specification.

So now in addition to the "numeric" and "number" specifications I already mentioned, I can use "float" - but neither specifies decimal places. You say # of decimals can't be specified - then ok. But I don't understand what float buys me that numeric and number doesn't ?

thanks for any additional clarification.

Dave.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top