Table (1 Viewer)

Assad

New member
Local time
Today, 08:37
Joined
Feb 21, 2024
Messages
3
hello i have written this kind of query in access 365 and am still getting the error "syntax in CREATE TABLE statement" what could be the problem
query.PNG
error.PNG
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:37
Joined
May 7, 2009
Messages
19,243
why not create the table in table designer not on DDE sql.
varchar is for MSSQL server only.

use:

Create Table Course (
c_id Text(4) Primary Key,
title Text(20),
dept_name Text(20),
credits Integer)
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:37
Joined
May 7, 2009
Messages
19,243
..so the error is in numeric(2,0)

you can use double or integer
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:37
Joined
May 7, 2009
Messages
19,243
CREATE TABLE, decimal being one of them
researching..
you can use ADO to create it:

CurrentProject.Connection.Execute "Create Table X_Table (DecField Decimal(18, 2))"
 

Assad

New member
Local time
Today, 08:37
Joined
Feb 21, 2024
Messages
3
i tried deleting the default table when opening access at the first time, and then i run my queries it worked, but what i can't understand is that the same format of queries i used to create another table, it failed! so i still can't put the finger on what access wants when creating a table.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:37
Joined
Feb 19, 2002
Messages
43,275
There are reasons for creating tables using DDL. Based on your last response, I'm guessing that this is not one of them. Temp tables just cause bloat. There are other solutions.
 

Users who are viewing this thread

Top Bottom