A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Striping a common word from a field



 
 
Thread Tools Display Modes
  #1  
Old September 13th, 2005, 11:39 AM
JohnB
external usenet poster
 
Posts: n/a
Default Striping a common word from a field

Hi.

Im working on an A2000/XP mdb which has a field containing entries like
"Maths Mentor", "English Mentor", "Music Mentor" etc. The second word is
always Mentor. Is there an expression I can use in a query that strips off
the "Mentor" part and allows me to produce a field in a report containing
just "Maths", "Music" etc? I'm not too worried about removing the space
between the words.

Thanks, JohnB
  #2  
Old September 13th, 2005, 12:03 PM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

See the online Help for the Replace() function.

Replace("Math Mentor", " Mentor", "")
....or...
Trim(Replace("Math Mentor", "Mentor", ""))
....will both return "Math"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"JohnB" wrote in message
...
Hi.

Im working on an A2000/XP mdb which has a field containing entries like
"Maths Mentor", "English Mentor", "Music Mentor" etc. The second word is
always Mentor. Is there an expression I can use in a query that strips off
the "Mentor" part and allows me to produce a field in a report containing
just "Maths", "Music" etc? I'm not too worried about removing the space
between the words.

Thanks, JohnB



  #3  
Old September 13th, 2005, 01:03 PM
JohnB
external usenet poster
 
Posts: n/a
Default

Hi Graham.
Thanks Graham.

I was confused a little at first until I realised that you meant:

Replace([Function], " Mentor", "")

where Function is the name of the field in question. Works perfectly when I
use that.

Thanks for the quick response, JohnB

"Graham R Seach" wrote:

See the online Help for the Replace() function.

Replace("Math Mentor", " Mentor", "")
....or...
Trim(Replace("Math Mentor", "Mentor", ""))
....will both return "Math"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

"JohnB" wrote in message
...
Hi.

Im working on an A2000/XP mdb which has a field containing entries like
"Maths Mentor", "English Mentor", "Music Mentor" etc. The second word is
always Mentor. Is there an expression I can use in a query that strips off
the "Mentor" part and allows me to produce a field in a report containing
just "Maths", "Music" etc? I'm not too worried about removing the space
between the words.

Thanks, JohnB




 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reveal Codes BAW General Discussion 2 June 7th, 2005 03:38 PM
In typing dates in Word, i.e. "January 12" how do you keep the "1. Carol General Discussion 2 January 12th, 2005 08:09 PM
word xp crashes after macros are recorded kharris0405 General Discussion 3 January 11th, 2005 10:50 PM
Continuous breaks convert to next page breaks Jennifer Hunt General Discussion 2 December 30th, 2004 05:45 PM
updating fields lost in cincy Mailmerge 5 November 18th, 2004 07:17 PM


All times are GMT +1. The time now is 08:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.