Format fields in Make Table Query

smiley1978

Board Regular
Joined
Sep 13, 2005
Messages
133
Is it possible to specify formats, field lenth, etc inside a make table query. I have a query that creates a table based on customer data, but at the same time, I am adding new fields that do not exist on any table and I want to define the data type, length etc... inside the make table query so that the query creates the table as I need it. The table that is made is used in queries later down the road. For all fields that I am adding, I am setting the value of the field to Null.

FYI.. MS Access 2007
 
Last edited:

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I have acc2003 not 2007.
You could create a data definition query to create the table you want with all the fields and sizes and data types you want. Then instead of a Make Table query, you could use an Append query to insert records into the newly created table.
 
Upvote 0
It really ends up being straight SQL.

In 2003 you have to goto query wizard, new, then get an sql view, then select SQL specific, then Data definition query. I'm not sure where it is exactly in 2007.

Here's a recent data definition query I had

CREATE TABLE XArticles (
ArticleID NUMBER NOT NULL PRIMARY KEY,
ArticleTitle TEXT(60) NOT NULL,
Copyright Number Not NULL
)
;

For SQL samples of create tables see
http://msdn.microsoft.com/en-us/library/bb177893(v=office.12).aspx

More info on sql here

http://msdn.microsoft.com/en-us/library/aa140011(v=office.10).aspx#acfundsql_ddl
http://msdn.microsoft.com/en-us/library/aa140015(v=office.10).aspx
http://msdn.microsoft.com/en-us/library/aa139977(v=office.10).aspx
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,266
Messages
6,189,939
Members
453,583
Latest member
Ok_category1816

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top