473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

CREATE TABLE

I am learning SQL using MS Access until I get SQL Server.

I am trying to create a table that includes time and date columns.

I receive the error: Syntax error in field definition.

Here is my code:

CREATE TABLE doughnut_ratings
(
location VARCHAR(50),
time DATETIME,
date DATE,
type CHAR(6),
rating VARCHAR(50)
comments VARCHAR(50)
);

How can I fix my code?

Thanks,

John
Nov 19 '08 #1
2 10469
On Nov 19, 2:59 pm, zufie <john.marru...@illinois.govwrote:
I am learning SQL using MS Access until I get SQL Server.

I am trying to create a table that includes time and date columns.

I receive the error: Syntax error in field definition.

Here is my code:

CREATE TABLE doughnut_ratings
(
location VARCHAR(50),
time DATETIME,
date DATE,
type CHAR(6),
rating VARCHAR(50)
comments VARCHAR(50)
);

How can I fix my code?

Thanks,

John
Hi John

I believe your field names of Time, Date and Type are reserved words
in Access. Try simply changing them to "ThisDate", "ThisTime", etc

Regards

Kevin
Nov 19 '08 #2
On Nov 19, 1:59*pm, zufie <john.marru...@illinois.govwrote:
I am learning SQL using MS Access until I get SQL Server.

I am trying to create a table that includes time and date columns.

I receive the error: Syntax error in field definition.

Here is my code:

CREATE TABLE doughnut_ratings
(
location VARCHAR(50),
time DATETIME,
date DATE,
type CHAR(6),
rating VARCHAR(50)
comments VARCHAR(50)
);

How can I fix my code?

Thanks,

John
Got code to work using MS Access.

Though MS Access did NOT like my use of the column names time and date
so I changed them to e and d, respectively

Here is my code:

CREATE TABLE doughnut_ratings
(
location VARCHAR(50),
e datetime,
d date,
type CHAR(6),
rating VARCHAR(50),
comments VARCHAR(50)
);

John
Nov 19 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Phil Powell | last post by:
create table if not exists nnet_produkt_varegruppe ( nnet_produkt_varegruppe_id int not null auto_increment, primary key(nnet_produkt_varegruppe_id), nnet_produkt_varegruppe_navn varchar(255) not...
6
by: dev | last post by:
how create a temp table as a copy of a existing table and then update1 field and insert the hole temp table back in the existing table? please any help? if i have 10 fields in 1 record and...
4
by: Michael Jackson | last post by:
I have a stored procedure to create a table. In my program I want the user to name the table to be created, therefore I pass a parameter to the SP for the table name. I cannot get it to work. It...
7
by: Wolfgang Kreuzer | last post by:
Hello all, I have two tables - Projects and ProjectStruct Table Projects contains master records of the projects, ProjectStruct allows to define a project herarchie and contains the fields...
1
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
24
by: flkeyman | last post by:
Work in legal office. Trying to create solid designed database structure. This is list of tables w/fields and primary keys. Any comments/advice greatly appreciated. tbl-Defendants CaseNumber...
6
by: Peter Nurse | last post by:
For reasons that are not relevant (though I explain them below *), I want, for all my users whatever privelige level, an SP which creates and inserts into a temporary table and then another SP...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
2
by: lakuma | last post by:
Hi, I have a table called A (say) with columns called name, place, animal and thing. I would want to write an on insert trigger on this table, which would create a table with the name of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.