PC Review


Reply
Thread Tools Rate Thread

Break apart data and then concatenate it back together

 
 
=?Utf-8?B?R2luYQ==?=
Guest
Posts: n/a
 
      1st Sep 2006
I know how to get the length of a given field from a query... ie below. This
gives me the last 2 digits in a year.

Year: Right([tbl_Closures1.Date_Process_Started],2)

What I need to do (this is something separate but related) is separate a
field with both first and last names to two separate fields. I then need to
concatenate them together with a third field that holds the data for an email
extension ie. @abc.com. My end goal is to get an email address for 120
employees (without typing them individually).

The standard is (E-Mail Removed). Everything past the @
sign is the same for every employee..

I thought of using the above script - but I don't know how to tell it to
stop at a space and also start at the space in order to capture first name
and then last name.

I also do not know how to concatenate in access.

Thank you in advance, your help is always appreciated.


--
Gina
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmVycnkgV2hpdHRsZQ==?=
Guest
Posts: n/a
 
      1st Sep 2006
Look into the Replace function to replace the space with a period.

Things to think about: Do you have anyone named something like Mary Ann
Gilligan or Billy Bob Thorton? What does your company do if there are two
John Smith's?
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Gina" wrote:

> I know how to get the length of a given field from a query... ie below. This
> gives me the last 2 digits in a year.
>
> Year: Right([tbl_Closures1.Date_Process_Started],2)
>
> What I need to do (this is something separate but related) is separate a
> field with both first and last names to two separate fields. I then need to
> concatenate them together with a third field that holds the data for an email
> extension ie. @abc.com. My end goal is to get an email address for 120
> employees (without typing them individually).
>
> The standard is (E-Mail Removed). Everything past the @
> sign is the same for every employee..
>
> I thought of using the above script - but I don't know how to tell it to
> stop at a space and also start at the space in order to capture first name
> and then last name.
>
> I also do not know how to concatenate in access.
>
> Thank you in advance, your help is always appreciated.
>
>
> --
> Gina

 
Reply With Quote
 
=?Utf-8?B?R2luYQ==?=
Guest
Posts: n/a
 
      1st Sep 2006
Jerry,

That's excellent thinking... I complicate simple things at times. One more
thing... How do you get the replace function to recognize that you are
wanting it to look for a space. I tried an acutal space, also " " and the #
sign.????
--
Gina


"Jerry Whittle" wrote:

> Look into the Replace function to replace the space with a period.
>
> Things to think about: Do you have anyone named something like Mary Ann
> Gilligan or Billy Bob Thorton? What does your company do if there are two
> John Smith's?
> --
> Jerry Whittle
> Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
>
>
> "Gina" wrote:
>
> > I know how to get the length of a given field from a query... ie below. This
> > gives me the last 2 digits in a year.
> >
> > Year: Right([tbl_Closures1.Date_Process_Started],2)
> >
> > What I need to do (this is something separate but related) is separate a
> > field with both first and last names to two separate fields. I then need to
> > concatenate them together with a third field that holds the data for an email
> > extension ie. @abc.com. My end goal is to get an email address for 120
> > employees (without typing them individually).
> >
> > The standard is (E-Mail Removed). Everything past the @
> > sign is the same for every employee..
> >
> > I thought of using the above script - but I don't know how to tell it to
> > stop at a space and also start at the space in order to capture first name
> > and then last name.
> >
> > I also do not know how to concatenate in access.
> >
> > Thank you in advance, your help is always appreciated.
> >
> >
> > --
> > Gina

 
Reply With Quote
 
BruceM
Guest
Posts: n/a
 
      1st Sep 2006
For the date you could just use:
TwoDigitYear: Format([YourDateField],"yy")
Year is the name of a function, so it should not be used as a field name.

For parsing names, some information here could give you a starting place:
http://www.mvps.org/access/strings/str0001.htm

To put them back together you could use an update query. Make an e-mail
field, then update it to something like:
LCase([FirstName]) & "." & LCase([LastName]) & "@emailaddress.com"

As Jerry pointed out, you could use the Replace function to set up the
e-mail address, which would work too. I am assuming you want to keep the
first and last names separate. Jerry pointed out the difficulties that will
arise from certain names such as Billy Bob Thornton, but I assume you would
just take care of things like that manually considering that you are dealing
with a relatively short list of names.

By the way, you may receive the suggestion that you could just concatenate
the e-mail addresses on the fly, but that won't work in some cases such as
Billy Bob or a duplicate name. Also, if somebody's name changes you may not
be be certain the e-mail address will change at the same time.

"Gina" <(E-Mail Removed)> wrote in message
news:291A403C-737A-47E4-B42F-(E-Mail Removed)...
>I know how to get the length of a given field from a query... ie below.
>This
> gives me the last 2 digits in a year.
>
> Year: Right([tbl_Closures1.Date_Process_Started],2)
>
> What I need to do (this is something separate but related) is separate a
> field with both first and last names to two separate fields. I then need
> to
> concatenate them together with a third field that holds the data for an
> email
> extension ie. @abc.com. My end goal is to get an email address for 120
> employees (without typing them individually).
>
> The standard is (E-Mail Removed). Everything past the
> @
> sign is the same for every employee..
>
> I thought of using the above script - but I don't know how to tell it to
> stop at a space and also start at the space in order to capture first name
> and then last name.
>
> I also do not know how to concatenate in access.
>
> Thank you in advance, your help is always appreciated.
>
>
> --
> Gina



 
Reply With Quote
 
=?Utf-8?B?R2luYQ==?=
Guest
Posts: n/a
 
      1st Sep 2006
Jerry and Bruce,

Thank you both. The information you have supplied has proven very valuable
to me. Although this is a short list, the next time it might prove to be in
the 10's of thousands. As our DB is reaching 100,000 records.

Again, thank you both for your time and knowledge.

--
Gina


"Gina" wrote:

> I know how to get the length of a given field from a query... ie below. This
> gives me the last 2 digits in a year.
>
> Year: Right([tbl_Closures1.Date_Process_Started],2)
>
> What I need to do (this is something separate but related) is separate a
> field with both first and last names to two separate fields. I then need to
> concatenate them together with a third field that holds the data for an email
> extension ie. @abc.com. My end goal is to get an email address for 120
> employees (without typing them individually).
>
> The standard is (E-Mail Removed). Everything past the @
> sign is the same for every employee..
>
> I thought of using the above script - but I don't know how to tell it to
> stop at a space and also start at the space in order to capture first name
> and then last name.
>
> I also do not know how to concatenate in access.
>
> Thank you in advance, your help is always appreciated.
>
>
> --
> Gina

 
Reply With Quote
 
=?Utf-8?B?SmVycnkgV2hpdHRsZQ==?=
Guest
Posts: n/a
 
      2nd Sep 2006
Something like this should work:

Debug.Print Replace("jerry whittle"," ",".")

The space should be in the second set of quotes and the period in the last.
Put the field name in the the first position enclosed by square brackets [ ]
without the double-quotes.

Happy to help.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Gina" wrote:

> Jerry,
>
> That's excellent thinking... I complicate simple things at times. One more
> thing... How do you get the replace function to recognize that you are
> wanting it to look for a space. I tried an acutal space, also " " and the #
> sign.????
> --
> Gina
>
>
> "Jerry Whittle" wrote:
>
> > Look into the Replace function to replace the space with a period.
> >
> > Things to think about: Do you have anyone named something like Mary Ann
> > Gilligan or Billy Bob Thorton? What does your company do if there are two
> > John Smith's?
> > --
> > Jerry Whittle
> > Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
> >
> >
> > "Gina" wrote:
> >
> > > I know how to get the length of a given field from a query... ie below. This
> > > gives me the last 2 digits in a year.
> > >
> > > Year: Right([tbl_Closures1.Date_Process_Started],2)
> > >
> > > What I need to do (this is something separate but related) is separate a
> > > field with both first and last names to two separate fields. I then need to
> > > concatenate them together with a third field that holds the data for an email
> > > extension ie. @abc.com. My end goal is to get an email address for 120
> > > employees (without typing them individually).
> > >
> > > The standard is (E-Mail Removed). Everything past the @
> > > sign is the same for every employee..
> > >
> > > I thought of using the above script - but I don't know how to tell it to
> > > stop at a space and also start at the space in order to capture first name
> > > and then last name.
> > >
> > > I also do not know how to concatenate in access.
> > >
> > > Thank you in advance, your help is always appreciated.
> > >
> > >
> > > --
> > > Gina

 
Reply With Quote
 
BruceM
Guest
Posts: n/a
 
      5th Sep 2006
When you say the DB is reaching 100,000 records, do you mean there are to be
100,000 separate names? If the same address appears in many records you may
need to take a look at your database's structure.

"Gina" <(E-Mail Removed)> wrote in message
news:49C67FA7-8915-40BB-895D-(E-Mail Removed)...
> Jerry and Bruce,
>
> Thank you both. The information you have supplied has proven very
> valuable
> to me. Although this is a short list, the next time it might prove to be
> in
> the 10's of thousands. As our DB is reaching 100,000 records.
>
> Again, thank you both for your time and knowledge.
>
> --
> Gina
>
>
> "Gina" wrote:
>
>> I know how to get the length of a given field from a query... ie below.
>> This
>> gives me the last 2 digits in a year.
>>
>> Year: Right([tbl_Closures1.Date_Process_Started],2)
>>
>> What I need to do (this is something separate but related) is separate a
>> field with both first and last names to two separate fields. I then need
>> to
>> concatenate them together with a third field that holds the data for an
>> email
>> extension ie. @abc.com. My end goal is to get an email address for 120
>> employees (without typing them individually).
>>
>> The standard is (E-Mail Removed). Everything past the
>> @
>> sign is the same for every employee..
>>
>> I thought of using the above script - but I don't know how to tell it to
>> stop at a space and also start at the space in order to capture first
>> name
>> and then last name.
>>
>> I also do not know how to concatenate in access.
>>
>> Thank you in advance, your help is always appreciated.
>>
>>
>> --
>> Gina



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Heading shading reflected back before a page-break Paddy Microsoft Word Document Management 3 11th Mar 2007 02:26 PM
How to Step back to caller in break mode pamelafluente@libero.it Microsoft VB .NET 2 5th Dec 2006 05:36 PM
How to get debugger back to set up break points in code behind =?Utf-8?B?TGlicw==?= Microsoft ASP .NET 0 27th Jul 2006 02:34 PM
How do I insert a line break when using the CONCATENATE function? =?Utf-8?B?U2hhbmVSdXRo?= Microsoft Excel Worksheet Functions 2 5th Nov 2004 11:26 PM
How do I Concatenate a Line Break Homey Microsoft Excel Worksheet Functions 2 5th Jan 2004 04:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:51 AM.