+ Reply to Thread
Results 1 to 6 of 6

Thread: Whats wrong with this code??

  1. #1
    Registered User
    Join Date
    12-23-2011
    Location
    pomona, ca
    MS-Off Ver
    Excel 2010
    Posts
    19

    Whats wrong with this code??

    Can someone please tell me what is wrong with this code? I am trying to create a table and then insert things into it so I can follow along with a tutorial on how to use Having and Group By statements in SQL.

    CREATE TABLE writer
    ("poet" varchar(50) default NULL,"anthology" varchar(40) default NULL,"Copies_In_Stock" tinyint(4) default NULL);

    It keeps returning a Syntax Error in CREATE TABLE

    Thanks In Advance

  2. #2
    Valued Forum Contributor alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Lake County, Illinois
    MS-Off Ver
    MS Office 2010, 2007 and 2002
    Posts
    1,161

    Re: Whats wrong with this code??

    Look here at the syntax for Create Table

    http://www.w3schools.com/sql/sql_create_table.asp

    I think that you need to remove the quotation marks from around your field names.

  3. #3
    Registered User
    Join Date
    12-23-2011
    Location
    pomona, ca
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Whats wrong with this code??

    Thanks, I tried to enter the code in that format, but still no luck. I'm going to study the syntax for what I am doing a little more in depth and post a solution if I find out! Thanks again for the help!

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    MSO2007 on WinXP/MSO2000 on Win7/winXP
    Posts
    2,174

    Re: Whats wrong with this code??

    So, what does your latest code look like?
    ---
    Ben Van Johnson

  5. #5
    Valued Forum Contributor
    Join Date
    12-14-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    986

    Re: Whats wrong with this code??

    I don't think access has tinyint type. That's for SQL Server if I remembered it correctly.
    To thank someone who has helped you, click on the star icon below their name.

    I hate reading

    Portfolio

    I need a job.
    I am young and incompetent

  6. #6
    Registered User
    Join Date
    12-23-2011
    Location
    pomona, ca
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Whats wrong with this code??

    JieJenn you were right, tinyint isnt supported by access and I had to take out the quotations and the word "default".....i was trying to enter a MySQL code into Access. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0