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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trim a field

Status
Not open for further replies.

Moxy1

Programmer
Aug 29, 2002
75
US
I have data in a field with an inconsistent length. At the end of each item is the word "Day". What is the best way to trim out the word Day?

Moxy
 
If "Day" is always at the end then
Code:
   myStr = Left ( myStr, Len(myStr)-3 )
If only some of the strings contain "Day" at the end then
Code:
   myStr = IIF (Right(myStr,3)="Day",
                Left ( myStr, Len(myStr)-3 ),
                myStr )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top