473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How do you create a new table with different field names

Hi all

I need to create a new table based on a source table.
The new table is almost the same as the source table in that just some field
names must change, and a few new fields added or dropped?

I was thinking of renaming the fields somehow, then using sql to add /drop?

Please give an example.

What is the best way to approach?
Thanks

Nov 12 '05 #1
6 1798
Keep it simple ! Use a make table query. You can change the field name by
putting a new name in front of the existing one at the top of the query grid
with a colon between. Like this - Newname:existingname
HTH
David B
Hexham UK

Jim's wife <ta*****@mindspring.com> wrote in message
news:PV**********************@news4.srv.hcvlny.cv. net...
Hi all

I need to create a new table based on a source table.
The new table is almost the same as the source table in that just some field
names must change, and a few new fields added or dropped?

I was thinking of renaming the fields somehow, then using sql to add /drop?

Please give an example.

What is the best way to approach?
Thanks


Nov 12 '05 #2
The simplest way is, in the database window, highlight the table, copy and
paste it -- you'll be asked for a new name. Then open the new table in
design view and make the changes.

Larry Linson
Microsoft Access MVP

"Jim's wife" <ta*****@mindspring.com> wrote in message
news:PV**********************@news4.srv.hcvlny.cv. net...
Hi all

I need to create a new table based on a source table.
The new table is almost the same as the source table in that just some field names must change, and a few new fields added or dropped?

I was thinking of renaming the fields somehow, then using sql to add /drop?
Please give an example.

What is the best way to approach?
Thanks

Nov 12 '05 #3
Hi all

Thanks for your help.
But I need to do this in code. Thanks!!

I look forward to your replies


"Jim's wife" <ta*****@mindspring.com> wrote in message
news:PV**********************@news4.srv.hcvlny.cv. net...
Hi all

I need to create a new table based on a source table.
The new table is almost the same as the source table in that just some field names must change, and a few new fields added or dropped?

I was thinking of renaming the fields somehow, then using sql to add /drop?
Please give an example.

What is the best way to approach?
Thanks

Nov 12 '05 #4
This works great until I have a field with spaces.
I get an error when there are spaces. I can't even do [New Fieldname]

is there a special character for a space I can try?

Thanks

"David B" <da***@marleycotenospam.fsnet.co.uk> wrote in message
news:bv**********@newsg3.svr.pol.co.uk...
Keep it simple ! Use a make table query. You can change the field name by putting a new name in front of the existing one at the top of the query grid with a colon between. Like this - Newname:existingname
HTH
David B
Hexham UK

Jim's wife <ta*****@mindspring.com> wrote in message
news:PV**********************@news4.srv.hcvlny.cv. net...
Hi all

I need to create a new table based on a source table.
The new table is almost the same as the source table in that just some field names must change, and a few new fields added or dropped?

I was thinking of renaming the fields somehow, then using sql to add /drop?
Please give an example.

What is the best way to approach?
Thanks

Nov 12 '05 #5

Użytkownik "Jim's wife" <ta*****@mindspring.com> napisał w wiadomo¶ci
news:PVOQb.18586
I need to create a new table based on a source table.
The new table is almost the same as the source table in that just some field names must change, and a few new fields added or dropped?
I was thinking of renaming the fields somehow, then using sql to add

/drop?

Hi!

Executing this:
SELECT * INTO YourNewTable FROM YourSourceTable
all data from the YourSourceTable will be copied to YourNewTable.
When you set condition WHERE to eg. 1=2, then you obtain new, empty table
named YourNewTable.

SELECT YourSourceTable.OldFieldName AS NewFieldName YourNewTable FROM
YourSourceTable;
Using this syntax you can set a new name to a specified field.

You may also change numbers of fields by creating new ones or droping
existing.
ALTER TABLE YourNewTable ADD COLUMN NewColumn DATE;
ALTER TABLE YourNewTable DROP COLUMN ColumnYouDontWant;

Leon!
Nov 12 '05 #6
thanks all

the sql strings in code worked using [renamed field]
for some reason it doesnt in the query designer

"Jim's wife" <ta*****@mindspring.com> wrote in message
news:PV**********************@news4.srv.hcvlny.cv. net...
Hi all

I need to create a new table based on a source table.
The new table is almost the same as the source table in that just some field names must change, and a few new fields added or dropped?

I was thinking of renaming the fields somehow, then using sql to add /drop?
Please give an example.

What is the best way to approach?
Thanks

Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tom | last post by:
Data is collected over time in an Excel worksheet with 20 columns. The Excel worksheet starts out as a copy of a template as is filled in as data is collected. Eventually the worksheet file is...
1
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
24
by: flkeyman | last post by:
Work in legal office. Trying to create solid designed database structure. This is list of tables w/fields and primary keys. Any comments/advice greatly appreciated. tbl-Defendants CaseNumber...
12
by: GCM | last post by:
Hi, I have a table that has the following fields; LName, FName and MName. Also there are other fields in the table. I need to create another table with those fields combined as "Trim( & " " & &...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
8
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
1
by: Dave | last post by:
I have multiple forms that will create an object. Basically a energy efficiency measure object. The measure object will have a couple of required properties set but after that it can have 10-20...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.