Displaying only the FIRST TWO WORDS of a field

I am writing a report that could get quite lengthy.  Therefore, instead of 
displaying the entire description in a report, is there anyway of displaying 
just the first two words of the description.

The format of the description field is "XXX <WordOfAnyLength>" where XXX is 
a fixed length of 3 characters, followed by a space.  The next word can be 
any length.  I would like to display the first two words in their entirety.

Thanks.
0
Utf
2/17/2010 2:25:02 PM
access.reports 4434 articles. 0 followers. Follow

1 Replies
636 Views

Similar Articles

[PageSpeed] 46

Try this expression in the query
Field: TwoWords: LEFT([Description],Instr(5,[Description] & " "," "))

Short explanation:
Instr will start looking for a space at the fifth character.  Concatenating a 
space on the end of Description just ensures that if you had a description 
like "xxx Oneword" that the data would be returned and not a zero-length string.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

brba wrote:
> I am writing a report that could get quite lengthy.  Therefore, instead of 
> displaying the entire description in a report, is there anyway of displaying 
> just the first two words of the description.
> 
> The format of the description field is "XXX <WordOfAnyLength>" where XXX is 
> a fixed length of 3 characters, followed by a space.  The next word can be 
> any length.  I would like to display the first two words in their entirety.
> 
> Thanks.
0
John
2/17/2010 3:03:41 PM
Reply:

Similar Artilces:

Word merged with Access
I am using both Word and Access 2003. When I merge a Word Letter with Access, sometimes not all of the queries show up, in the drop down box, to link the letter with. Does anyone have any ideas of why this happens? Is there a way to make all of the queries show up? Are the queries limited to a certain number? I would appreciate any help or ideas that you can give me. Aurora Aurora Without more information, I can only guess... Any chance any of those queries that are not showing up are NOT "select" queries (i.e., they are Make Table, or Delete or Insert queri...

Need Excel code to work in Word
I found this spreadsheet by John Walkenbach (Excel Guru) that has code I'd like to use in Word. http://spreadsheetpage.com/index.php/tip/mail_merge_without_word 1. John's Excel file has a help button that displays a userform. 2. The userform displays directions to guide the user on how to do something in Excel. 3. The directions (text) in the userform is stored in one of the sheets in the workbook. Those are the elements I care about. A userform with text that is editable. The procedure in John's Excel file talks you through doing a mail merge in Excel without u...

instructions disppear when users begin type (text field)
Hi all, I need to customize the outlook contact form and I want to add one text field to allow users to add details info and instruct users how to add. Instructions shows in the field and the instructions disappear when users click and begin to type. How should I do this? exchange 2003/outlook2003 Thank you. It's hard for me to visualize exactly what you're expecting to happen. If you want the instructions to stay on the screen, you could display them in a label control. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumps...

Updating Boolean Field with onChange
I am having difficulty with setting a value of a new boolean field using the OnChange scripting against a picklist. If anyone has some sample code / formatting information that I can use it would be greatly appreciated. Also, I also need to know if it is possible to stop the default value for the Revenue (isrevenuesystemcalculated) field on the opportunity form being set to "Yes" when the "Convert Lead" function is used. We can set the default value to "No" for user created Opportunities but when Convert Lead is used it seems to ignore the default value. Again, a...

When hitting reply to a message, no "Bcc:" header field appears
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: Exchange Hi. When I hit &quot;Reply&quot; or &quot;Reply All&quot; to a message in Entourage, the composition window that appears has the usual &quot;To:&quot;, &quot;Cc:&quot;, and &quot;Subject:&quot; form fields near the top, but not one for &quot;Bcc:&quot;. I've looked all over Preferences but don't see an option for this. What am I missing? <br><br>Thanks, <br><br>-c On 2/26/10 11:51 AM, cmetzler@officeforma...

How do I Hide text in Word 2007 document?
In Word 2000 there was a "Hidden Text" command available. I can't find this in Word 2007. Select the text that you want to hide. Press Ctrl+Shift+H. If you want to make use of the Font dialog box, you can do this: On the Home tab, click the dialog launcher (the arrow at the bottom right) of the Font group. In the dialog box, select "Hidden" and click OK. -- Stefan Blom Microsoft Word MVP "DeccoEur" <DeccoEur@discussions.microsoft.com> wrote in message news:21EABE67-2970-4F80-BEEE-C59255D4E1E2@microsoft.com... > In Word 2000 ...

Change default fonts in Word 2007
I would like to change the default font, size, style etc that Word 2007 uses when I open a new document. Is this possible? If so could anybody tell me how? Thanks Yes, you can create your own theme / template. See http://office.microsoft.com/en-us/word/HA102045501033.aspx See http://office.microsoft.com/en-us/word/HA100307561033.aspx Yves "Rob" <Rob@discussions.microsoft.com> wrote in message news:C456E186-952E-4796-98DC-A70D8FF83D8D@microsoft.com... >I would like to change the default font, size, style etc that Word 2007 >uses > when I op...

Word to Excel conversion
As we are able to mail merge from the Excel data, is it possible to convert MS Word labels into Excel Data? Hi how do you store your data currently?. If it is in a Word Table you may simply copy+paste thiese contents to Excel -- Regards Frank Kabel Frankfurt, Germany vkumar2000@hotmail.com wrote: > As we are able to mail merge from the Excel data, is it > possible to convert MS Word labels into Excel Data? ...

Fields
I am working in an education template and want to see if there is a way to create a field that can be added to periodically to show all the courses a person takes from my instructors. I created a field named course but it is only allowing me to put one course in. How can I make the field list all the courses? Thanks, Nantika -- Enjoy every day! On Sat, 17 Apr 2010 09:18:01 -0700, Nantika <Nantika@discussions.microsoft.com> wrote: >I am working in an education template and want to see if there is a way to >create a field that can be added to periodically ...

Dialog displayed
Hi I'm creating a dialog and calling it with domodal(). Is there a message handler or something insode my dialogclass that is called after the dialog is displayed? Thanks Urban Yes & No. Take a look at the OnInitDialog() message handler. OnInitDialog() gets called before the dialog is displayed. However you can post a user-defined message to yourself from the OnInitDialog() handler, and handle things that you want to do after the dialog is displayed. -- Cheers Check Abdoul [ VC++ MVP ] ----------------------------------- "Urban Stadler" <mail@ustadler....

how do I display email addresses memorized by autocomplete?
I have many email addresses that autocomplete has memorized, but that have not been entered into my contacts, that I would like to access. Any ideas? This is a great tool for it: http://www.nirsoft.net/utils/outlook_nk2_autocomplete.html -- Ricardo Silva Add-ins for Microsoft(c) Outlook(c) http://www.rsoutlook.com/us/products.html "alyankee" <alyankee@discussions.microsoft.com> wrote in message news:09CC2496-662A-4919-904C-EF6D93A51033@microsoft.com... >I have many email addresses that autocomplete has memorized, but that have > not been entered i...

Reports and making it look prettier: Last Name, First Name Rank
I'm trying to pretty up my report by eliminating the forced space created by having one field of the report for 'LastName', one for 'FirstName', and one for 'Rank.' The Rank isn't too huge of an issue, and if three items in one field gets to be too much, I have no problem leaving that as a side item of sorts. But, I want my report to look a bit better by putting the names together! I want the report to go to my table, pull the LastName from that column, and pair it with the matching FirstName in the column to the right. (Since it's just...

How do I merge two publisher files?
I am using publisher 2003. I am creating an 80 page catalog. I like to save page 1-10 as file one, pages 11-20 as file two and so on. When I am finished with my catalog I need to send one file to the printer. How can I merge all of my pages together in one file? Copy and paste. Or if you have Acrobat (not just the free Reader) you can create a single .pdf file with the parts. -- JoAnn Paules MVP Microsoft [Publisher] "screnda" <screnda@discussions.microsoft.com> wrote in message news:CF96E50B-CBC8-4A5A-A854-D7EE130CE9AD@microsoft.com... >I am using publisher 200...

Using two conditions in a formula
How do I write the following formula: I am in cell I6 If g6 AND h6 is blank, then blank, else I5 minus g6 plus h -- Richard Pit ----------------------------------------------------------------------- Richard Pitt's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1533 View this thread: http://www.excelforum.com/showthread.php?threadid=27042 Richard, In cell I6, enter the formula: =IF(AND(G6="",H6=""),"",I5-G6-H6) Though you don't check for case when G6 is blank and H6 isn't, etc. HTH, Bernie MS Excel MVP "Richard ...

Default value for custom field?
How can I populate a custom field with a default value? Specifically, I have a custom field "DisplayName" associated with the Quote Detail object. I want initially to populate this field with the value of the product name field when a new product is added to a quote. The user can then edit the DisplayName custom field if desired. The DisplayName custom field will be used as the product name on a Crystal Reports quote form. ...

Amount in words to be printed on the invoice
Hi Mates, I need to print the invoice amount in words in MRMS 2.0 Any suggestions Thanks this is available through Microsoft. check out the following site: https://mbs.microsoft.com/customersource/support/downloads/reportslibrary/rms_reportslibrary.htm "RK" wrote: > Hi Mates, > > I need to print the invoice amount in words in MRMS 2.0 > > Any suggestions > > Thanks ...

modify description field in reports
When I print my PO's I can make the part # field in the view report screen wider but when i print it, it defaults back to the regular size. The problem is it cuts off my part numbers on some of my long numbers. Is there a way to overcome this? you must modify the po.xml file directly. "www.choppersapparel.com" <www.choppersapparel.com@discussions.microsoft.com> wrote in message news:8B4E31D5-10A7-4A99-913D-F8F6E3BD7043@microsoft.com... > When I print my PO's I can make the part # field in the view report screen > wider but when i print it, it defaults ...

How do you change a field name in 2002 Excel
I have copied and pasted a whole database from Works into the Excel program but can't seem to find a way to change the field names from A, B, C, to what I want as Last Names, First Names, etc. Aarrrrgh. It can't be THAT difficult! <G> Using the HELP did nothing for me thus I am here asking this silly Q. AnnE in MN You cannot change the Column letters from A, B, C etc. You can choose to have column and row headers not shown under Tools>Options>View Enter your titles(names) in row 1 then select A2 and Window>Freeze Panes to lock row 1 in view. Gord Di...

Multiple indexes on same fields in different order
I sometimes need to find the largest or smallest value in a field. If I put two indexes on the same field, one in ascending order and one in descending order, is Jet smart enough to use the proper index if a give it a grouping query with the condition Max or Min, or am I just wasting resources? Pete -- This e-mail address is fake, to keep spammers and their address harvesters out of my hair. If you want to get in touch personally, I am 'pdanes' and I use yahoo mail. But please use the newsgroup when possible, so that all may benefit from the exchange of ideas. ...

Windows and Mac have two distinctly different units for column width.
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I am trying to format columns for some data I am entering in a spreadsheet and when I enter &quot;15.00&quot;, which is the required width for these columns given by my professor, I end up with a column 15 inches wide. What I would prefer is for the options to be like the default options in Windows version of Excel. In Windows version of Excel, when you hover over the lines between the columns it gives you two numbers (e.g. 8.43 (64 pixels)). These are the default numbers for column width in Windows Excel....

Excel object within Word doc
I am sure I am doing something in error ... but all I want to do is take a spreadsheet and embed it in my word doc. I click on 'Insert', then 'Object', choose 'Excel 97-2003', 'Display as Icon', copy data into spreadsheet, 'save', 'close and return' ... However, when I go to view it at a later time - the spreadsheet does not open and I end up in the picture editing part of Word. ...

Is there a list of characters that Word considers equivalent on Fi
Word's Find will find "equivalent" characters. For example, a find for straight quotes will also find curly quotes, and a find for a space will also find a non-breaking space. Where can I find a list of the characters that Word considers equivalent in this sense? Thanks. ...

Converting a Microsoft Word document to a PC document
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have created a Resume and a cover letter in Microsoft Word on a Mac to be uploaded to the Institute ORACLE recruitment system. <br><br>When I checked how it looked, the format, the bullets and formating were blown apart! I was told to convert the documents to PC format. <br><br>I don't know how to do this. I got some guidance to make them PDF files, but the formating still goes haywire! How do I do the conversion on my Mac? Hi Meg: The most important thing to do is DO NOT TEL...

Ease of visibility of the Ribbon in Word 2007 and Excel 2007
As installed the colour intensity of the Ribbon in Word and Excel 2007 is very faint and it is not particularly easy to read. Is there some means of increasing the colour intensity to make it easier to read? I have fairly good sight but still have difficulty. Unless the colour intensity can be adjusted it must be virtually impossible for people with poor sight to read the details on the Ribbon. Try this (not sure if you will have this on your computer but it is worth a try):- Control Panel / Ease of Access / Ease of Access Center There are a number of options in here ...

Two different cells
I have a file with more the 1000 names and addresses. My proble is that the firat and last names are in 2 differents cells. I i would like to put it in teh same cell. Is there anyway I csn do that? Please help too many names to re-type Carlos Assuming that Column A contains the first name and Column B the last name... =A1&" "&B1 OR =B1&", "&A1 ....depending on your preference. Hope this helps! In article <520FA0CA-1940-42E5-B84D-22BA15D59638@microsoft.com>, "Hombreck" <Hombreck@discussions.microsoft.com> wrote: > I have a...