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

Split function in Crystal report 1

Status
Not open for further replies.

AFK1

IS-IT--Management
Aug 26, 2005
38
US
I need to create a formula to display a specific text based on a vlue. I am trying to see if my id is 1234 then split the IDCODE and give me the fisrt value of the delimiter...here is my code...

IDCODE= 1234!0009

if ID = '1234' then
Local StringVar array Myval
local StringVar returnValue
Myval := (Split({IDCODE}, "!"))
//OptionAValue
If Trim(Myval) <> "" then
returnValue:=Myval[0]
Else
""
else
IDCODE




Can someone help me on what am i doing wrong..
 
Lots of little issues.
I think you can do it this way:

local stringvar IDCODE := "1234!0009"; //change this to your IDCODE field
local stringvar ID := "1234"; //change this to your ID field

if ID = "1234" then
trim(split(IDCODE,"!")[1])
else
IDCODE

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top