Connecting Tech Pros Worldwide Forums | Help | Site Map

Create Table?

GCM
Guest
 
Posts: n/a
#1: Jul 11 '06
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



DFS
Guest
 
Posts: n/a
#2: Jul 11 '06

re: Create Table?


GCM wrote:
Quote:
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 ...


Keith Wilby
Guest
 
Posts: n/a
#3: Jul 11 '06

re: Create Table?


"DFS" <nospam@dfs_.comwrote in message
news:49Nsg.89047$qd2.45685@bignews6.bellsouth.net. ..
Quote:
GCM wrote:
Quote:
>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


Lyle Fairfield
Guest
 
Posts: n/a
#4: Jul 11 '06

re: Create Table?


DFS wrote:
Quote:
GCM wrote:
Quote:
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.

GCM
Guest
 
Posts: n/a
#5: Jul 12 '06

re: Create Table?


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" <here@there.comwrote in message
news:44b39f44_1@glkas0286.greenlnk.net...
Quote:
"DFS" <nospam@dfs_.comwrote in message
news:49Nsg.89047$qd2.45685@bignews6.bellsouth.net. ..
Quote:
>GCM wrote:
Quote:
>>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
>

Lyle Fairfield
Guest
 
Posts: n/a
#6: Jul 12 '06

re: Create Table?


GCM wrote:
Quote:
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?

DFS
Guest
 
Posts: n/a
#7: Jul 12 '06

re: Create Table?


Keith Wilby wrote:
Quote:
"DFS" <nospam@dfs_.comwrote in message
news:49Nsg.89047$qd2.45685@bignews6.bellsouth.net. ..
Quote:
>GCM wrote:
Quote:
>>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?



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


Quote:
Keith.
www.keithwilby.com

DFS
Guest
 
Posts: n/a
#8: Jul 12 '06

re: Create Table?


Lyle Fairfield wrote:
Quote:
DFS wrote:
Quote:
>GCM wrote:
Quote:
>>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...


Quote:
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.




Quote:
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...



Keith Wilby
Guest
 
Posts: n/a
#9: Jul 12 '06

re: Create Table?


"DFS" <nospam@dfs_.comwrote in message
news:Xd0tg.89218$qd2.24343@bignews6.bellsouth.net. ..
Quote:
Keith Wilby wrote:
Quote:
>>
>But why bother?
>
Because he asked?
>
Let's hope no-one asks you how to boil their head ;-)

Keith.


DFS
Guest
 
Posts: n/a
#10: Jul 12 '06

re: Create Table?


Keith Wilby wrote:
Quote:
"DFS" <nospam@dfs_.comwrote in message
news:Xd0tg.89218$qd2.24343@bignews6.bellsouth.net. ..
Quote:
>Keith Wilby wrote:
Quote:
>>>
>>But why bother?
>>
>Because he asked?
>>
>
Let's hope no-one asks you how to boil their head ;-)
First you peel off the skin...



Keith Wilby
Guest
 
Posts: n/a
#11: Jul 12 '06

re: Create Table?


"DFS" <nospam@dfs_.comwrote in message
news:f22tg.89221$qd2.4327@bignews6.bellsouth.net.. .
Quote:
Keith Wilby wrote:
Quote:
>"DFS" <nospam@dfs_.comwrote in message
>news:Xd0tg.89218$qd2.24343@bignews6.bellsouth.net ...
Quote:
>>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?


GCM
Guest
 
Posts: n/a
#12: Jul 12 '06

re: Create Table?


Hi Lyle,

To answer your questions...

"Lyle Fairfield" <lylefairfield@aim.comwrote in message
news:1152678168.979037.181270@s13g2000cwa.googlegr oups.com...
Quote:
GCM wrote:
Quote:
>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.
Quote:
>
Do you load a form with all 4 000 000 records?
Yes, and it works well.
Quote:
>
Do you print a letter to them all?
No, its for information look-ups only... no changes or additions by the
user.
Quote:
>
E-mail ...?
No
Quote:
>
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.
Quote:
>
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.
Quote:
>
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.
Quote:
>
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.
Quote:
>

Lyle Fairfield
Guest
 
Posts: n/a
#13: Jul 12 '06

re: Create Table?


GCM wrote:
Quote:
Hi Lyle,
>
To answer your questions...
>
"Lyle Fairfield" <lylefairfield@aim.comwrote in message
news:1152678168.979037.181270@s13g2000cwa.googlegr oups.com...
Quote:
GCM wrote:
Quote:
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.
Quote:

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

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

E-mail ...?
No
Quote:

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.
Quote:

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.
Quote:

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.
Quote:

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, " ", " ")

Closed Thread