CREATE TABLE CONS
(
Com_Type TEXT(150),
Cons_2008 DOUBLE,
Cons_2009 DOUBLE,
Cons_2010 DOUBLE
);
Writing Query in Microsoft Access, error in field description [closed]
-
08-10-2022 - |
Question
I am writing a query in Microsoft Access. and I am getting a syntax error in "field description". Here is the code:
CREATE TABLE CONS
(
Com_Type text,
Cons_2008 double(10,2),
Cons_2009 double(10,2),
Cons_2010 double(10,2)
);
Thanks!
Solution 2
OTHER TIPS
Specify the length of the text field, unless you want a field of length 255 when called through an Access query or a Memo
field when called through an ADO connection.
Com_Type Text(50),
The Double
type has no size and scale specifications. Either drop them or use the Decimal
type.
Cons_2008 Double
Or
Cons_2008 Decimal(10, 2)
Note: See this SO answer for a limitation related to the decimal type.
When using the Double
type, you can still specify a format in the TextBoxes
linked to this table column. That way you can force the display of 2 decimals.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow