473,397 Members | 1,974 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,397 software developers and data experts.

Create Table?

GCM
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([LName] & " " & [FName] & " " & [MName]). How
can I create this table?

Thanks in advance...
GCM
Jul 11 '06 #1
12 3466
DFS
GCM wrote:
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([LName] & " " & [FName] & "
" & [MName]). How can I create this table?

Thanks in advance...
GCM

SELECT (Trim(LName) & ' ' & Trim(FName) & ' ' & Trim(MName)) AS FullName
INTO NewTable
FROM ExistingTable
WHERE ...
Jul 11 '06 #2
"DFS" <nospam@dfs_.comwrote in message
news:49*******************@bignews6.bellsouth.net. ..
GCM wrote:
>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([LName] & " " & [FName] & "
" & [MName]). How can I create this table?

Thanks in advance...
GCM


SELECT (Trim(LName) & ' ' & Trim(FName) & ' ' & Trim(MName)) AS FullName
INTO NewTable
FROM ExistingTable
WHERE ...

But why bother? A normalised system would have the names stored discreetly
and concatenated at runtime in a query.

Keith.
www.keithwilby.com
Jul 11 '06 #3
DFS wrote:
GCM wrote:
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([LName] & " " & [FName] & "
" & [MName]). How can I create this table?

Thanks in advance...
GCM


SELECT (Trim(LName) & ' ' & Trim(FName) & ' ' & Trim(MName)) AS FullName
INTO NewTable
FROM ExistingTable
WHERE ...
Years ago SELECT (Trim(LName) & ' ' & Trim(FName) & ' ' & Trim(MName))
might result in two spaces in some cases where a field was null or held
a zero length string. I don't know if that is the case anymore but a
solution has been discussed many times here as in:

http://groups.google.ca/group/comp.d...07ea4bc514ad10

where Arvin writes:

"Try:

=[Street1] & (", " + [Street2]) & (", " + [Town]) & (", " + [County]) &
(",
" + [PostCode])

The "+" operator will not concatenate with a null, while the "&" will."

Regardless, I am with Keith in wondering if creatig this table is
REALLY necessaryfor the original poster as the first part of your query
gives all that the new table gives.

Jul 11 '06 #4
GCM
But with 4,000,000 records a query runs really slow... that's why I want a
new table with a permenant field...

Thanks for your help,
GCM
"Keith Wilby" <he**@there.comwrote in message
news:44********@glkas0286.greenlnk.net...
"DFS" <nospam@dfs_.comwrote in message
news:49*******************@bignews6.bellsouth.net. ..
>GCM wrote:
>>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([LName] & " " & [FName] & "
" & [MName]). How can I create this table?

Thanks in advance...
GCM


SELECT (Trim(LName) & ' ' & Trim(FName) & ' ' & Trim(MName)) AS FullName
INTO NewTable
FROM ExistingTable
WHERE ...


But why bother? A normalised system would have the names stored
discreetly and concatenated at runtime in a query.

Keith.
www.keithwilby.com

Jul 12 '06 #5
GCM wrote:
But with 4,000,000 records a query runs really slow... that's why I want a
new table with a permenant field...
Runs really slow for what?

Do you load a form with all 4 000 000 records?

Do you print a letter to them all?

E-mail ...?

Who are the four million people whose names you have?

What happens to the size of your database when you create this new
table?

It's certainly true that something would run slowly for these four
million records: the make table query "SELECT INTO ... " How would you
keep this new table current? When one person changes his/her name, when
you find one spelling error do you delete and then recreate this Table?
When one person is added to the list ... ?

When you want a subsetof these names, say all the "Howards" will it be
slower to filter out the other records when LastName is one field or
when LastName must be extracted from the entire name field?

Jul 12 '06 #6
DFS
Keith Wilby wrote:
"DFS" <nospam@dfs_.comwrote in message
news:49*******************@bignews6.bellsouth.net. ..
>GCM wrote:
>>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([LName] & " " &
[FName] & " " & [MName]). How can I create this table?

Thanks in advance...
GCM


SELECT (Trim(LName) & ' ' & Trim(FName) & ' ' & Trim(MName)) AS
FullName INTO NewTable
FROM ExistingTable
WHERE ...


But why bother?
Because he asked?

A normalised system would have the names stored
discreetly and concatenated at runtime in a query.


Keith.
www.keithwilby.com

Jul 12 '06 #7
DFS
Lyle Fairfield wrote:
DFS wrote:
>GCM wrote:
>>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([LName] & " " &
[FName] & " " & [MName]). How can I create this table?

Thanks in advance...
GCM


SELECT (Trim(LName) & ' ' & Trim(FName) & ' ' & Trim(MName)) AS
FullName INTO NewTable
FROM ExistingTable
WHERE ...

Years ago SELECT (Trim(LName) & ' ' & Trim(FName) & ' ' & Trim(MName))
might result in two spaces in some cases where a field was null or
held a zero length string.
If someone didn't have a first name...
I don't know if that is the case anymore
but a solution has been discussed many times here as in:

http://groups.google.ca/group/comp.d...07ea4bc514ad10

where Arvin writes:

"Try:

=[Street1] & (", " + [Street2]) & (", " + [Town]) & (", " + [County])
& (",
" + [PostCode])

The "+" operator will not concatenate with a null, while the "&"
will."
I did not know that. Thanks.


Regardless, I am with Keith in wondering if creatig this table is
REALLY necessaryfor the original poster as the first part of your
query gives all that the new table gives.
There can be any number of scenarios where he needs a discrete table of full
names. Mine is not to question why...

Jul 12 '06 #8
"DFS" <nospam@dfs_.comwrote in message
news:Xd*******************@bignews6.bellsouth.net. ..
Keith Wilby wrote:
>>
But why bother?

Because he asked?
Let's hope no-one asks you how to boil their head ;-)

Keith.
Jul 12 '06 #9
DFS
Keith Wilby wrote:
"DFS" <nospam@dfs_.comwrote in message
news:Xd*******************@bignews6.bellsouth.net. ..
>Keith Wilby wrote:
>>>
But why bother?

Because he asked?

Let's hope no-one asks you how to boil their head ;-)
First you peel off the skin...

Jul 12 '06 #10
"DFS" <nospam@dfs_.comwrote in message
news:f2******************@bignews6.bellsouth.net.. .
Keith Wilby wrote:
>"DFS" <nospam@dfs_.comwrote in message
news:Xd*******************@bignews6.bellsouth.net ...
>>Keith Wilby wrote:

But why bother?

Because he asked?

Let's hope no-one asks you how to boil their head ;-)

First you peel off the skin...
Shouldn't it come off as part of the boiling process, similar to a tomato?
Jul 12 '06 #11
GCM
Hi Lyle,

To answer your questions...

"Lyle Fairfield" <ly***********@aim.comwrote in message
news:11**********************@s13g2000cwa.googlegr oups.com...
GCM wrote:
>But with 4,000,000 records a query runs really slow... that's why I want
a
new table with a permenant field...

Runs really slow for what?
The searches run really fast, but any query takes a few minutes to run.
>
Do you load a form with all 4 000 000 records?
Yes, and it works well.
>
Do you print a letter to them all?
No, its for information look-ups only... no changes or additions by the
user.
>
E-mail ...?
No
>
Who are the four million people whose names you have?
It is a death record index for an entire state to be used by genealogists,
school class searches, lawyers, bondsmen and etc. It has already been in use
for a couple of years and would be much easier to use with the names
combined in a string by using a "Start of Field" search.
>
What happens to the size of your database when you create this new
table?
Good question. It jumped from 979,848kb to 1,346,052kb, but when I delete
the old LName, FName, MName fields and then delete the old table (no longer
needed) I'm sure the size will drop, perhaps even lower than the original.
>
It's certainly true that something would run slowly for these four
million records: the make table query "SELECT INTO ... " How would you
keep this new table current? When one person changes his/her name, when
you find one spelling error do you delete and then recreate this Table?
When one person is added to the list ... ?
Again, there will be no updates, ever.
>
When you want a subsetof these names, say all the "Howards" will it be
slower to filter out the other records when LastName is one field or
when LastName must be extracted from the entire name field?
You can run a filter select all Howards or selecting all Howards in a
certain county in only a second or two. Very fast. There are only 6 fields
per record.
>

Jul 12 '06 #12
GCM wrote:
Hi Lyle,

To answer your questions...

"Lyle Fairfield" <ly***********@aim.comwrote in message
news:11**********************@s13g2000cwa.googlegr oups.com...
GCM wrote:
But with 4,000,000 records a query runs really slow... that's why I want
a
new table with a permenant field...
Runs really slow for what?
The searches run really fast, but any query takes a few minutes to run.

Do you load a form with all 4 000 000 records?
Yes, and it works well.

Do you print a letter to them all?
No, its for information look-ups only... no changes or additions by the
user.

E-mail ...?
No

Who are the four million people whose names you have?
It is a death record index for an entire state to be used by genealogists,
school class searches, lawyers, bondsmen and etc. It has already been in use
for a couple of years and would be much easier to use with the names
combined in a string by using a "Start of Field" search.

What happens to the size of your database when you create this new
table?
Good question. It jumped from 979,848kb to 1,346,052kb, but when I delete
the old LName, FName, MName fields and then delete the old table (no longer
needed) I'm sure the size will drop, perhaps even lower than the original.

It's certainly true that something would run slowly for these four
million records: the make table query "SELECT INTO ... " How would you
keep this new table current? When one person changes his/her name, when
you find one spelling error do you delete and then recreate this Table?
When one person is added to the list ... ?
Again, there will be no updates, ever.

When you want a subsetof these names, say all the "Howards" will it be
slower to filter out the other records when LastName is one field or
when LastName must be extracted from the entire name field?
You can run a filter select all Howards or selecting all Howards in a
certain county in only a second or two. Very fast. There are only 6 fields
per record.
Your reasons sound good to me and I have done something similar with
data which was regulation bound not to change except on one date each
year. As the calculations to create the data were costly in terms of
time and resources it was efficient to create an annual table which
could be referenced but not changed.

I think you will need to address the issue of null fields and double
spaces in your table creating SQL. A simple solution that may handle
any cases of the double space is to enclose your function as follows.
Replace(Your function, " ", " ")
assuming your are using Access >=2000

or to run a second query updating FullName to
Replace(FullName, " ", " ")

Jul 12 '06 #13

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

Similar topics

4
by: Phil Powell | last post by:
create table if not exists nnet_produkt_varegruppe ( nnet_produkt_varegruppe_id int not null auto_increment, primary key(nnet_produkt_varegruppe_id), nnet_produkt_varegruppe_navn varchar(255) not...
6
by: dev | last post by:
how create a temp table as a copy of a existing table and then update1 field and insert the hole temp table back in the existing table? please any help? if i have 10 fields in 1 record and...
4
by: Michael Jackson | last post by:
I have a stored procedure to create a table. In my program I want the user to name the table to be created, therefore I pass a parameter to the SP for the table name. I cannot get it to work. It...
7
by: Wolfgang Kreuzer | last post by:
Hello all, I have two tables - Projects and ProjectStruct Table Projects contains master records of the projects, ProjectStruct allows to define a project herarchie and contains the fields...
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...
6
by: Peter Nurse | last post by:
For reasons that are not relevant (though I explain them below *), I want, for all my users whatever privelige level, an SP which creates and inserts into a temporary table and then another SP...
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...
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...
2
by: lakuma | last post by:
Hi, I have a table called A (say) with columns called name, place, animal and thing. I would want to write an on insert trigger on this table, which would create a table with the name of the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.