472,122 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,122 software developers and data experts.

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 2482
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,497 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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.