Print Page | Close Window

Create field using portion of another field

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18254
Printed Date: 28 Apr 2024 at 11:07am


Topic: Create field using portion of another field
Posted By: troverman
Subject: Create field using portion of another field
Date Posted: 13 Dec 2012 at 4:44am
Hi,

There is a field in a table which contains a string of data, then two spaces, and then another string of data. I need the first and second strings of data to become separate fields. I believe, using a formula, this can be done. However, aside from selecting the field in the formula window, I'm not sure how it can be done. I need to know which function or operator to use. Basically "take the first 8 characters of field x and create field y" if that makes sense. Then I need another formula which says "take the last 7 characters of field x and create field z."

Thanks in advance



Replies:
Posted By: comatt1
Date Posted: 13 Dec 2012 at 5:19am
two formulas

y
left({field},8})

z
right({field},7})


if you find the spaces cause issue you can always use the trim() function to remove them.



Print Page | Close Window