By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,436 Members | 2,958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,436 IT Pros & Developers. It's quick & easy.

CREATE TABLE

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.