Hi everyone.
I am trying to run an alter table sql on an imported table to insert a field.
Access doesn't like the table name in the following and throws a syntax error:
Alter table Page 4- People
Add Column FacilityID Numeric
Is there a way to get this to work using the existing table name (bad as it is) ? There is an existing import and overwrite process that looks for that table name which would be a mess to rework.
Thank you for any help.
-Scott
Alter table syntax error
-
- Administrator
- Posts: 78457
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Alter table syntax error
If a table or field name contains spaces, punctuation etc., you must enclose it in square brackets.
And Numeric is not a valid data type in Access - use Long for whole numbers, or Double for numbers with decimals.
So, for example:
ALTER TABLE [Page 4- People] ADD COLUMN FacilityID LONG
And Numeric is not a valid data type in Access - use Long for whole numbers, or Double for numbers with decimals.
So, for example:
ALTER TABLE [Page 4- People] ADD COLUMN FacilityID LONG
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Alter table syntax error
Thank you Hans.
-
- 4StarLounger
- Posts: 528
- Joined: 26 Jan 2010, 15:14
Re: Alter table syntax error
Thanks for the heads-up and a Happy Easter
-
- Administrator
- Posts: 78457
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands