473,698 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3492
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_.co mwrote in message
news:49******** ***********@big news6.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.com wrote in message
news:44******** @glkas0286.gree nlnk.net...
"DFS" <nospam@dfs_.co mwrote in message
news:49******** ***********@big news6.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_.co mwrote in message
news:49******** ***********@big news6.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_.co mwrote in message
news:Xd******** ***********@big news6.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_.co mwrote in message
news:Xd******** ***********@big news6.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

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

Similar topics

4
4053
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 null ); create table if not exists nnet_produkt_farge ( nnet_produkt_farge_id int not null auto_increment, primary key(nnet_produkt_farge_id),
6
6576
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 about 100 records and a field.status=1 in a existing_table and i want to create a temp_table with all the recordse and values of the existing_table and then update the field.status to 2 and insert in 1 query the temp_table in the existing_table
4
4435
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 creates a table called "@NewTableName". Any ideas? CREATE PROCEDURE dbo.sp_FFProduction_CreateTable (
7
9671
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 PrjStructId, ProjectId, PrjStructName, ..., ParentId PrjStructParent contains a reference to the parent or to itselves if record is top-level-record for a project.
1
3357
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, ============================================================================== A1 |A2 A3 A4 A5 A6 A7 A8 |A9 A10 A11 | 01/02/04 |02/02/04 StaffName |Work Hr OT Hr Slot1...
24
3105
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 (primary key) FirstName MiddleName LastName
6
7707
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 which reads and drops the same temporary table. My users are not able to create dbo tables (eg dbo.tblTest), but are permitted to create tables under their own user (eg MyUser.tblTest). I have found that I can achieve my aim by using code like...
27
3781
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 updates the same data in all other four tables in the right places. I know it would be possible by using the ForeignKeyConstraint object. I have created the tables using the DataSet Visual Tool and I know it doesn't create any ForeignKeyConstraint obj....
4
12437
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 this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
2
2432
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 value entered in the name column. Let's say a new column is entered with the value of name column as mickey. I want to create a table called mickey, with the help of triggers. I'm really new to this and i would like some help. Thanks in advance for...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8901
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.