
Larry C. answered 02/19/19
Computer Science and Mathematics professional
I don't think Access recognizes the CHAR type. Try changing them to VARCHAR.
Lee M.
asked 02/18/19can you explain what I did wrong
I Am trying to make an sql table in Microsoft Access but I am getting a syntax error for create table with the following code:
CREATE TABLE SALES_REP (
REP_NUM CHAR( 2 ) PRIMARY KEY,
LAST_NAME VARCHAR( 15 ),
STREET CHAR( 15 ),
CITY CHAR( 15 ),
STATE CHAR( 2 ),
POSTAL_CODE CHAR( 5 ),
COMMISION NUMERIC( 7, 2 ),
RATE NUMERIC( 3, 2 ) );
Larry C. answered 02/19/19
Computer Science and Mathematics professional
I don't think Access recognizes the CHAR type. Try changing them to VARCHAR.
Patrick B. answered 02/19/19
Math and computer tutor/teacher
it worked for me (screen shot to prove it if you want)
BUT I am using sqlite
STATE may be a reserved word.
Try using sales-rep prefix to mangle your column names:
salesRepLastName,
salesRepFirstName,
salesRepSTATE
salesRepCITY,
etc
I only use VARCHAR, DECIMAL, and INTEGER
otherwise, your syntax looks good, no missing commas, and
balanced parenthesis
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.