A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Add several fields or columns



 
 
Thread Tools Display Modes
  #1  
Old October 2nd, 2004, 08:33 AM
david
external usenet poster
 
Posts: n/a
Default Add several fields or columns

Hi,
Starting out with a table (Table1) how may I, using design grid preferably:
(i) add several new fields to Table1 ?
(ii) add the same fields in a new table (Table2) whose records corresponds
to the existing table via IDs?
[Think of Table1 as having people's name, and new fields to be added are
social security and date of birth. ]
Thanks.
David
  #2  
Old October 2nd, 2004, 01:02 PM
Dan Artuso
external usenet poster
 
Posts: n/a
Default

Hi,
Do you mean you wish to add the new fields using SQL as opposed to
opening the table in design view?
You can use the Alter Table statement but you can't do it from the query design grid.
You must choose the SQL view.

Here's an example of adding your date of birth field:

ALTER TABLE Table1 ADD COLUMN DOB DATETIME;

Not sure what data type you want the social security to be.

Also, there is no need to add these fields to another related table.
If your tables are linked by IDs, just use a query to see results from both tables.

--
HTH
Dan Artuso, Access MVP


"david" wrote in message ...
Hi,
Starting out with a table (Table1) how may I, using design grid preferably:
(i) add several new fields to Table1 ?
(ii) add the same fields in a new table (Table2) whose records corresponds
to the existing table via IDs?
[Think of Table1 as having people's name, and new fields to be added are
social security and date of birth. ]
Thanks.
David



  #3  
Old October 3rd, 2004, 11:33 PM
david
external usenet poster
 
Posts: n/a
Default

Hi Dan,
You have answered question 1 of my 2 questions. Thanks.
Could you help figure out question 2 as well?
For question 2, my intent is to place the new fields (DOB, etc) in a new
table.
How may I create this new table (which initially may hold just blanks for
field values - i.e. the data for DOB etc will be copied from some other
sources later.)
In other words, I need to create the new table (as place holders) and be
able to link it by querry to the first table, record by record.
Hope my explanation is not too confusing.

David

"david" wrote:

Hi,
Starting out with a table (Table1) how may I, using design grid preferably:
(i) add several new fields to Table1 ?
(ii) add the same fields in a new table (Table2) whose records corresponds
to the existing table via IDs?
[Think of Table1 as having people's name, and new fields to be added are
social security and date of birth. ]
Thanks.
David

  #4  
Old October 4th, 2004, 12:49 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Sun, 3 Oct 2004 15:33:03 -0700, "david"
wrote:

In other words, I need to create the new table (as place holders) and be
able to link it by querry to the first table, record by record.
Hope my explanation is not too confusing.


If you will be populating the new table with the intent that it
contain data from the old table, you can cut out the intermediate step
by creating a MakeTable query based on your old table.

If you create an empty table there is nothing in its records upon
which you can link!

If for some reason you really need the multistep process, try:

- Copy and paste the table to a new table; choose the "design only"
option. This will create an empty table with all the fields of the old
table.
- Go into design mode and delete fields as needed.
- Run an Append query from the old table into the new table, using
criteria as appropriate to select which records to add.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fields - Columns Bill Worksheet Functions 3 September 7th, 2004 08:36 AM
Menu Bar Security and UNHIDING columns AccessNana General Discussion 1 August 29th, 2004 02:33 PM
comparing data and return only data that exsist in the 2 columns victorwill Worksheet Functions 2 December 27th, 2003 01:13 AM
Adding rows in two dynamic columns Justin Etheredge Worksheet Functions 0 November 24th, 2003 11:27 PM


All times are GMT +1. The time now is 12:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.