Update query Formatting

D

Dave

I am trying to populate a new field in the DB with parts of several other
fields but am having some formatting issues

Here is my update code:

=[FirstName] & [LastName] & Mid([studentid],6,4) & "@xxxx.com"

Here are my issues
1. I need this to be all lower case (I tried Lower([FirstName]) but no luck)
2. Some of the names have spaces and hyphens. Can they me removed in the
update? Hyphens removal is less important but the spaces need to go. "Trim"
does not work because these are not always Leading spaces.


Thanks

dave


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
K

KARL DEWEY

Try this --
=LCase(Replace(Replace(([FirstName] & [LastName] & Mid([studentid],6,4) &
"@xxxx.com"), " ",""), "-", ""))
 
K

kc-mass

Try

=Lcase(replace([FirstName]," ","")) & " " & Lcase(replace([LastName]," ","))
& Mid([studentid],6,4) & "@xxxx.com

Regards

Kevin
 
D

Dave

Thank you both.

Dave

Dave said:
I am trying to populate a new field in the DB with parts of several other
fields but am having some formatting issues

Here is my update code:

=[FirstName] & [LastName] & Mid([studentid],6,4) & "@xxxx.com"

Here are my issues
1. I need this to be all lower case (I tried Lower([FirstName]) but no
luck)
2. Some of the names have spaces and hyphens. Can they me removed in the
update? Hyphens removal is less important but the spaces need to go.
"Trim" does not work because these are not always Leading spaces.


Thanks

dave

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4515 (20091016) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4515 (20091016) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top