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!

conditional printing everything before a string in a field

Status
Not open for further replies.

GCL2007

IS-IT--Management
Dec 11, 2007
167
US
Am trying to create a formula for a value based on the last three characters of a field. If Right(fieldname,3) = "-MX" or "-US" I want to display everything to the left of the -MX or -US. If there is no -MX or -US in the field I want to leave it alone and just display the value of the fieldname as it is..Any thoughts?
 
if the characters are always the last three, the below should work.

//{@AllButRight3}
LEFT({table.field},LEN({table.field})-3)

.
...
disclaimer: i do not have crystal in front of me so apologize in advance for any mistakes/typos.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top