469,127 Members | 1,305 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,127 developers. It's quick & easy.

Create SQL Table Syntax

133 100+
Hi,

I am having a syntax error creating a table. The table is defined with space and special characters, are these allowed when defining a table. thank you in advance for your guidance.

mary

the code is as follows:

Expand|Select|Wrap|Line Numbers
  1. CurrentDb.Execute ("CREATE TABLE tbl_IDT([Sales Order Id] Integer, " & _
  2.                                         "[Sales Order No] Integer, " & _
  3.                                         "Fund VARCHAR(6), " & _
  4.                                         "Org VARCHAR(6), " & _
  5.                                         "[Sales Order Date/Time Created] DateTime, " & _
  6.                                         "[Buyer: First Name] VARCHAR(25), " & _
  7.                                         "Quantity as integer, " & _
  8.                                         "[Unit Price] money, " & _
  9.                                         "[Extended Price] money, " & _
  10.                                         "[SKU/Catalog #] VARCHAR(25), " & _
  11.                                         "[Product Description] VARCHAR(50),  " & _
  12.                                         "[Account Code] VARCHAR(6))")
  13.  
Feb 18 '11 #1
2 2432
dowlingm815
133 100+
the answer is yes, my code was error-ing due to the "As" clause that i wasn't seeing.
Feb 18 '11 #2
NeoPa
32,162 Expert Mod 16PB
Right on the button Mary. Line #7 is your culprit. The AS SQL keyword creates an alias, rather than defining a field type.
Feb 19 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by John Haney | last post: by
4 posts views Thread by Baoqiu Cui | last post: by
3 posts views Thread by J West | last post: by
2 posts views Thread by Karen Sullivan | last post: by
7 posts views Thread by Zri Man | last post: by
1 post views Thread by bodyboarder20 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.