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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |