+ Reply to Thread
Results 1 to 6 of 6

Whats wrong with this code??

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

    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
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    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.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

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

    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
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Whats wrong with this code??

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

  5. #5
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Whats wrong with this code??

    I don't think access has tinyint type. That's for SQL Server if I remembered it correctly.

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

    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.6.0 RC 1