Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to selectivly remove the right character. 1

Status
Not open for further replies.

bosk00

Technical User
Mar 5, 2004
91
US
In my database I have a field that contains client Company names. One of its uses is as a data source used in mail merge. There are names that end with a period, ie "Company, Inc." In some instatnces the field needs to be at the end of a sentence, which ends in a period. Useing this code I can check the last character to see if it is a period.
Code:
 IIf(Right([QAMAIN].[COMPANY],1)=".","Period","Not Period") AS Test
I think I need to use RTRIM Where it now shows "Period", But I have had no luck with the syntax. All Help is appreciated. Thanks

Alan
Senility at its finest
 
Hi!

To trim off the last character you can do this:

Left(YourField, Len(YourField) - 1)

hth


Jeff Bridgham
bridgham@purdue.edu
 
First off that did it. Thank You. Now let me see if I got it, using the left selects the entry from the left, and the len -1 shortens the length by 1 character. BTW have a star.

Alan
Senility at its finest
 
Hi Alan!

Exactly correct, and thanks for the star.



Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top