Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CREATE TABLE simple question

Status
Not open for further replies.

albin1e4

IS-IT--Management
Nov 21, 2002
7
US
In the CREATE statement below, ACCESS indicates that number(3) is a syntax error. What is wrong with this very simple statement? Thanks for your help.
Brian


CREATE TABLE tblEmployee
(
firstName varchar(30),
lastName varchar(30),
title varchar(30),
age number(3),
salary number
);
 
Yes it does, but ACCESS will accept neither. I only used the one field as an example of the problem.

Brian
 
does it work if you take the (3) out?
Code:
CREATE TABLE tblEmployee
(
firstName varchar(30),
lastName varchar(30),
title varchar(30),
age number,
salary number
);

Leslie
 
It works, but the idea is to use SQL to control the field size. For instance,
salary number
should be ...
salary number (8,2)

Access balks at that type of formatting.

Brian

 
did you try specifing the type of number?

integer or long integer or double?
Code:
CREATE TABLE tblEmployee
(
firstName varchar(30),
lastName varchar(30),
title varchar(30),
age integer (3),
salary double(8,2)
);

(wild guess here!! but thought it might be worth a try??)

leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top